How to package & deploy Node.js + express web application?

前端 未结 6 1680
忘掉有多难
忘掉有多难 2020-12-07 09:36

I am new to Node.js programming and I have recently created a sample working web application using (express, backbone & other complimentary view technologies, with mongo

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 10:07

    There is no standardized way, but you're on the right track. If your package.json is up to date and well kept, you can just copy/zip/clone your app directory to the production system, excluding the node_modules.

    On your production system, run npm install to install your dependencies, npm test if you have tests and finally NODE_ENV=production node server.js

    Some recent slides I considered to be quite helpful that also include the topic of wrappers like forever, can be found here.

提交回复
热议问题