async function bootstrap() {
const app = await NestFactory.create(AppModule);
- await app.listen(3000);
+ const PORT = Number(process.env.PORT) || 8080;
+ await app.listen(PORT);
}
bootstrap();
{
...
+ "main": "dist/main.js",
"scripts": {
...
- "build": "nest build",
+ "build": "tsc -p tsconfig.build.json",
+ "gcp-build": "npm run build",
...
- "start": "nest start",
+ "start": "node ./dist/main.js",
}
...
}