Skip to content
atarashi
Documentation menu

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|js
  • src/routes/index.ts|js
  • src/lib/http.ts (when provides('language:typescript'))
  • src/lib/http.js (when provides('language:javascript'))
  • src/lib/async-handler.ts (when provides('language:typescript'))
  • src/lib/async-handler.js (when provides('language:javascript'))

Dependencies

  • express@^4.21.2

Development only:

  • @types/express@^4.17.23 (when provides('language:typescript'))

Environment

VariableRequiredDescription
PORTnoPort the HTTP server listens on

What it contributes to other files

FileSlotLine
src/config/env.ts|jsenv-schemaPORT: z.coerce.number().int().positive().default(3000),
src/index.ts|jsimportsimport { app } from './app.js';
src/index.ts|jsimportsimport { env } from './config/env.js';
src/index.ts|jsbootstrapapp.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.