Reputation: 257
Let's suppose I have Express application and install it such way:
npm install
/config
What if I want automatically perform some actions on deploy, like default user creation, fill some collections by start data, etc. How can I do that on the most generic way?
And how can I do it without business logics duplication in a kind of deploy.js
to be run, if the app is a REST API?
Upvotes: 0
Views: 42
Reputation: 87
You can initially run a a file like node setup.js
.
Once that is complete run the express.js application like so: node app.js
.
The setup.js
would initialize pre-deploy configurations.
Does that make sense?
Upvotes: 1