This example starts an ExpressJS server written in TypeScript.
- Express 5
- TypeScript
- Security headers via helmet
- CORS enabled
- Install dependencies
pnpm install - Copy
.env.exampleto.env(optional, defaults to port 3333) - Start the development server
pnpm dev - Build for production
pnpm build
The server returns a healthcheck status: "ok" payload in JSON at the root. The server code is located in src/index.ts.
A versioned API route is available in src/api.ts with an example endpoint at /api/v1/hello.
Express 5 handles async route handlers natively — no wrapper needed.
Set NODE_ENV=production in your Railway service variables. Railway does not set this automatically.
- Faraz Patankar / Railway team for the original template