# Express API

> HTTP APIs with Express and TypeScript. Use when adding routes, middleware, error handling, or validation on Express, not NestJS.

- Skill: `vostrikovva/express-api` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vostrikovva/express-api`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vostrikovva/express-api/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: vostrikovva (https://skillmd.com/u/vostrikovva)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/vostrikovva/express-api

---


# Express + TypeScript

Use when the server is Express. If the repo is NestJS, follow `nestjs` instead.

Source layout is a default. Real directories come from the `implement`/`tdd` recon of `package.json` and `tsconfig.json` (monorepo, `paths`).

## Defaults

- `express` + TypeScript. Type `Request`/`Response` handlers; do not use untyped `any` callbacks.
- One place for errors: centralized error middleware. Route handlers `next(err)` or `async` wrapper. Do not `res.status` from random helpers inconsistently.
- Validate body/query at the edge (e.g. zod). Infer types from the schema.
- Do not log tokens, passwords, or `Authorization` headers.

## Structure

Keep routers thin: parse → call a typed service → map result to HTTP. Business rules do not live in middleware.

## Secrets

Read `process.env` in a small config module with explicit types. Never dump `.env` into chat.

