Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run a fastify server in production #705

Open
2 tasks done
zoulou00 opened this issue Feb 6, 2024 · 2 comments
Open
2 tasks done

How to run a fastify server in production #705

zoulou00 opened this issue Feb 6, 2024 · 2 comments

Comments

@zoulou00
Copy link

zoulou00 commented Feb 6, 2024

Prerequisites

  • I have written a descriptive issue title
  • 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

@mcollina
Copy link
Member

mcollina commented Feb 8, 2024

That seems a bit extreme. I would change that script and split the build and start steps.

@zoulou00
Copy link
Author

Hi I created a PR, please take a look #707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants