Fastify
Integrate Fastify with Nitro using the server entry.
server.node.ts
import Fastify from "fastify";
const app = Fastify();
app.get("/", () => "Hello, Fastify with Nitro!");
await app.ready();
export default app.routing;
Server Entry
server.node.ts
import Fastify from "fastify";
const app = Fastify();
app.get("/", () => "Hello, Fastify with Nitro!");
await app.ready();
export default app.routing;
Nitro auto-detects server.node.ts in your project root and uses it as the server entry.
Call await app.ready() to initialize all registered plugins before exporting. Export app.routing (not app) to provide Nitro with the request handler function.
The
.node.ts suffix indicates this entry is Node.js specific and won't work in other runtimes like Cloudflare Workers or Deno.