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

前端 未结 6 1688
忘掉有多难
忘掉有多难 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:15

    few ways to approach this:

    • Push your code into Git repository, excluding everything that isn't your code (node_modules/**), then pull it in your staging environment, run npm install to restore all dependencies

    • create an NPM package out of it , install it via npm in your staging environment (this should also take care of all of the dependencies)

    • manual copy/ssh files to your staging environment (this can be automated with Grunt), than restore your dependencies via npm

提交回复
热议问题