An Express 4 REST API starter for Node.js 22 in plain JavaScript, for developers who want a small, tested skeleton to add their own routes to. It includes CORS, JSON body parsing, a /health check, JSON 404 and 500 responses and node:test tests, with no database and no build step.
by Light CloudREST APIs
The app is plain CommonJS JavaScript that npm start runs directly, with configuration read once in src/config.js and errors handled by two middleware functions in src/middleware/errors.js. Keeping the app and the server in separate files is what lets the tests start it on port 0 and call it with fetch. The first things to change are the CORS origin in src/app.js and the routes in src/routes/index.js, where new routers mount before the 404 handler. On Light Cloud it runs npm start in a container on the PORT the platform sets, and every push to your copy redeploys it.
Yes. This Express 4 starter is MIT licensed and free to copy from GitHub, and it fits within Light Cloud's Free plan, which includes 3 server apps with no card needed.
Add a handler to src/routes/index.js, or create a router file in src/routes/ and mount it in src/app.js with app.use('/things', thingsRouter). Mount it before the notFound handler so it is reached.
The starter calls app.use(cors()), which allows every origin. Pass your origins instead, for example app.use(cors({ origin: 'https://example.com' })).
No. It is plain JavaScript with no build step. If you want TypeScript, the NestJS API starter is the typed option in the same gallery.
Yes. It contains no Light Cloud code: any host with Node.js 22 runs it with npm ci --omit=dev and npm start, with PORT set.
Start an Express CRUD API on PostgreSQL with validation, paging and tests set up
Start a Node.js API with Fastify 5, request logs and in-memory tests on one dependency
Start a TypeScript API with NestJS modules, Jest unit and e2e tests and linting set up