Deploying a Fastify application involves generally the same steps in deploying any Node.js application to production — copy code to server,
npm install dependencies and run (
A few things to keep in mind:
Try and follow Fastify's deployment recommendations.
Your Vite application must be bundled before it can be served in production. After the build, your application bundle will be available in
- If you accidentally set
truein your fastify-vite plugin settings, you'll be using Vite's development server instead of the live rendering handler provided by your chosen framework (via the renderer adapter). Vite's development server is automatically turned off in case the
NODE_ENVenvironment variable is set to
productionwhen the application boots.
Anything beyond that is likely related to the particular server platform you're deploying to.
You'll need Node v14+.