Express
What Gigadrive Network detects for an Express project, which file it runs as the Function, and the defaults it applies.
Gigadrive Network detects Express from an express entry in the dependencies or devDependencies of your root package.json. Nothing else is required: the server you already start with app.listen() is deployed as one Function that answers every path.
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 |
Express is tried second to last, ahead of only Vite, so any other framework in your dependencies wins. A project that also depends on Next.js, Nuxt, NestJS, Hono, Fastify or Elysia is detected as that framework instead.
The platform runs no build step of its own for Express. If your package.json has a build script, the build runs it with the package manager it detected; otherwise it installs dependencies and packages the project as it is. See Builds.
The entrypoint
The preset resolves the server file from your project instead of assuming one. 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. index.js, thensrc/index.js,index.ts,src/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, so compile TypeScript first and point main at the compiled file.
That file must either call listen() while it is being imported or export the Express app or an http.Server. The server is captured during import and each request is forwarded to it, so the port you pass to listen() is ignored. Capturing a real server is also what makes WebSocket upgrades work, so an Express app with ws or socket.io needs no extra configuration.
Changing the defaults
version: 4
functions:
server.js:
runtime: node-22
memory: 512
max_duration: 60A functions block replaces every entrypoint the preset produced, and any setting you leave out falls back to the config file's own defaults of memory: 128 and max_duration: 30 rather than the preset's. routes works the same way: one route of your own replaces the preset's /* route, so add it back if you still need it.
Express documents its own API at expressjs.com.
