http/express
Express HTTP server with a health check, a versioned router and JSON response helpers.
Provides: http, http:express
Requires: runtime:node, config:env
Conflicts with: http
Files it writes
src/app.ts|jssrc/routes/index.ts|jssrc/lib/http.ts(whenprovides('language:typescript'))src/lib/http.js(whenprovides('language:javascript'))src/lib/async-handler.ts(whenprovides('language:typescript'))src/lib/async-handler.js(whenprovides('language:javascript'))
Dependencies
express@^4.21.2
Development only:
@types/express@^4.17.23(whenprovides('language:typescript'))
Environment
| Variable | Required | Description |
|---|---|---|
PORT | no | Port the HTTP server listens on |
What it contributes to other files
| File | Slot | Line |
|---|---|---|
src/config/env.ts|js | env-schema | PORT: z.coerce.number().int().positive().default(3000), |
src/index.ts|js | imports | import { app } from './app.js'; |
src/index.ts|js | imports | import { env } from './config/env.js'; |
src/index.ts|js | bootstrap | app.listen(env.PORT, () => { |
Use it
atarashi new my-app --add http/express
atarashi add http/express
Version 1.0.0. Format reference: Authoring blueprints.
Part of the atarashi documentation, written and maintained by Gautam Suthar.