0

I have a javascript file that I use in Nodejs to populate my database with fake data. So in my project folder I do:

node fakedata.js

which populates my database with fake data. I deployed my website to heroku and I want to be able to run the same javacript in my heroku database. Is there a way to run javascript file like this on the heroku server?

2 Answers 2

1

This turned out to be pretty simple:

heroku run node populateData.js
Sign up to request clarification or add additional context in comments.

Comments

0

Yes ofcourse !
You can edit your Procfile as follows

web: node fakedata.js && <Your App Startup Command>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.