Skip to content

example api

github-actions[bot] edited this page Feb 27, 2026 · 2 revisions

Example API Endpoints

Base URL: http://127.0.0.1:3000

The example app uses global prefix api, so routes start with /api.

Root

  • GET /api/
  • Response: welcome string

Health

  • GET /api/health

  • Response: OK

  • GET /api/health/db

  • Response: DB_READY

Users (v1)

  • GET /api/v1/users/
  • GET /api/v1/users/count
  • GET /api/v1/users/{id}
  • GET /api/v1/users/{id}/exists
  • POST /api/v1/users/
  • PUT /api/v1/users/{id}
  • PUT /api/v1/users/{id}/replace
  • DELETE /api/v1/users/{id}

Create User Body

{
  "name": "Alice",
  "email": "alice@example.com"
}

Update User Body

{
  "name": "Alice Updated",
  "email": "alice2@example.com"
}

Settings (v1)

  • GET /api/v1/settings/runtime
  • GET /api/v1/settings/
  • GET /api/v1/settings/{id}
  • POST /api/v1/settings/
  • PUT /api/v1/settings/{id}
  • DELETE /api/v1/settings/{id}

Versioning Demo

  • GET /api/v1/versioning/hello
  • GET /api/v2/versioning/hello

Error Shape

NestForge errors return a consistent JSON shape:

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "..."
}

Clone this wiki locally