qbodart
qbodart

Reputation: 419

How to deploy Nestjs App (on Azure)?

I am trying to deploy a Nestjs API (with Auth0 authentication). When I run it in VS Code with npm run start:watch server, everything's fine. Now the question is: what should I do to deploy it on a webserver? Should I only copy the dist folder (after runnin tsc)? what about node_modules? Should I leave the port to 3000? As a side note I am trying to deploy it on Azure but I guess the questions holds for any platform.

Many thanks!

Upvotes: 6

Views: 3605

Answers (1)

Jesú Castillo
Jesú Castillo

Reputation: 331

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'

Upvotes: 3

Related Questions