nodejs express app deploying to production

后端 未结 2 689
执笔经年
执笔经年 2021-01-19 04:09

Sorry if this is a basic question, I am still wrapping my head around nodejs deployments. I have an app written on nodejs which I want to deploy to production. So far for

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-19 04:51

    When you create your application with express.js, all express modules have been specified in package.json and will be installed as npm modules.

    All you need to do is just install node.js on your production servers, put your code there, run npm install, then start the web server with NODE_ENV=production param. It would be a plus if you can use grunt or gulp to process static assets (js / css minification, ...) to optimize the performance for production mode.

    For more information, you can take a look here: https://expressjs.com/en/advanced/best-practice-performance.html

提交回复
热议问题