问题
Under scripts
in package.json
I have the following.
'refresh': node refresh db
Is there a way to trigger this particular npm script on a NodeJS app deployed on Heroku.
回答1:
Yes:
$ heroku run npm run refresh
回答2:
Per the Heroku Node.js Documentation, you can add pre and post install scripts. In addition, you can add scripts that can be triggered by environment variables.
来源:https://stackoverflow.com/questions/38571318/how-to-run-a-npm-script-on-a-deployed-heroku-nodejs-app