fastify-cli
fastify-cli copied to clipboard
How to run a fastify server in production
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the issue has not already been raised
Issue
Hi,
I have scaffolded my project with : fastify generate myproject --esm --lang=ts
In my package.json, I have:
start": "npm run build:ts && fastify start -l info dist/app.js",
"build:ts": "tsc",
To run my sever in a production environnement do I need to run npm run start ?
So every time I start the server it will rebuild the ts files ?
Thanks
That seems a bit extreme. I would change that script and split the build and start steps.
Hi I created a PR, please take a look https://github.com/fastify/fastify-cli/pull/707