Fastify
What Gigadrive Network detects for a Fastify project, which file it runs as the Function, and the defaults it applies.
Gigadrive Network detects Fastify from a fastify entry in the dependencies or devDependencies of your root package.json. Your server becomes one Function that answers every path.
Fastify support is experimental. The preset is a minimal Node server definition with nothing Fastify-specific behind it, so check that your first deployment serves traffic before you rely on it.
Defaults
| Setting | Value |
|---|---|
| Runtime | node-22 |
| Memory | 128 MB |
| Max duration | 30 seconds |
| Route | /* to the resolved entrypoint |
| Environment | NODE_ENV=production |
| Build | your package.json build script |
Fastify is detected ahead of Express and behind Hono and Elysia, so a project depending on more than one of them resolves to the higher-priority framework.
The entrypoint
The preset starts from src/index.ts and then resolves the real server file from your project. The first candidate that exists on disk wins:
maininpackage.json.- The file argument of
scripts.start, when that script is a plainnode,bun run,tsxorts-nodeinvocation. src/index.ts, thenindex.js,src/index.js,index.ts,app.js,src/app.js,server.js,src/server.js,app.ts,src/app.ts,server.ts,src/server.ts.
The Node runtime executes JavaScript. A TypeScript Fastify project has to build to JavaScript and point main at the compiled file, otherwise the resolved src/index.ts will not run.
Call await app.listen(...) in that file, or export the http.Server it wraps. The server is captured during import and requests are forwarded to it, so the port and host you pass are ignored. Fastify bootstraps asynchronously in most projects, and a listen() that fires up to 15 seconds after the import completes is still captured.
Changing the defaults
version: 4
functions:
dist/server.js:
runtime: node-22
memory: 512
max_duration: 60A functions block replaces every entrypoint the preset produced, and settings you leave out fall back to the config file's defaults of memory: 128 and max_duration: 30. Declaring your own routes likewise replaces the preset's /* route.
Fastify documents its own API at fastify.dev.
