如何部署Nestjs App(在Azure上)?

时间:2017-12-07 11:39:42

标签: node.js express nestjs

我正在尝试部署Nestjs API(使用Auth0身份验证)。当我使用npm run start:watch server在VS代码中运行它时,一切都很好。 现在的问题是:我应该怎么做才能在网络服务器上部署它?我应该只复制dist文件夹(在runnin tsc之后)吗?那node_modules呢?我应该把港口留到3000吗? 作为旁注,我试图在Azure上部署它,但我想这些问题适用于任何平台。

非常感谢!

1 个答案:

答案 0 :(得分:3)

Modify your package.json file, and add a postinstall script, this script should be tsc or tsc --sourceMap false if you would like to avoid sourceMaps from being generated.

That would make azure to run tsc after installing all npm packages, remember to change start script also, so its value is 'node dist/index.js'