# Deploy Express on forkrail

> Run existing Express apps on Node 24 arm64 with zero code changes — both `export default app` and `app.listen(process.env.PORT)` work, with TypeScript bundled automatically.

- Framework: Express
- Category: APIs & backends
- Status: Production ready
- Adapter / Preset: None (automatic Express launcher or PORT listener)
- Runtime: Node.js 24 or 22 (arm64)
- Detection: app / index / server (.ts|.js|.mjs) or package.json main
- Memory: 640 MB default
- URL: https://www.forkrail.com/frameworks/express

## Capabilities

| Capability | Support | Details |
| --- | --- | --- |
| Export or listen() | Supported | Accepts export default app or app.listen(process.env.PORT) |
| TypeScript ready | Supported | Bundled automatically with esbuild (respects type: module) |
| 10× concurrency | Supported | One warm Express process handles up to 10 concurrent requests |
| Public static files | Supported | Files in public/ served by the router before Express wakes |

## 1. Write or bring your Express app

forkrail detects Express from `package.json` and locates `app`, `index`, or `server` (at the root or in `src/`, in `.ts`, `.js`, `.mjs`, `.cjs`, `.mts`, `.cts`). Export the app directly or bind `process.env.PORT` — both styles work identically:

**src/index.ts**

```ts
import express from 'express'

const app = express()
app.use(express.json())

app.get('/api/health', (_req, res) => {
  res.json({ ok: true, runtime: process.version })
})

export default app
```

Need Node 22 instead of the Node 24 default? Set `"engines": { "node": "22.x" }` in `package.json`. `NODE_ENV=production` is automatically set for both previews and production so Express hides stack traces on error responses.

## 2. Deploy & configure limits

**Deploy Express and configure memory or timeouts**

```bash
forkrail deploy
forkrail deploy --prod

# Adjust memory or maxDuration for future deployments
forkrail project orders-api --memory 1024 --max-duration 60
```

## Related documentation

- [Concurrent compute](https://www.forkrail.com/docs/concurrent-compute.md)
- [Logs & observability](https://www.forkrail.com/docs/logs-and-observability.md)
- [Firewall](https://www.forkrail.com/docs/firewall.md)
