Skip to content

Example API

The route surface exposed by the main example application.

The example app runs by default at:

http://127.0.0.1:3000

It also applies a global /api prefix.

  • GET /api/
  • GET /api/health
  • GET /api/health/db

Versioned user routes live under /api/v1/users:

  • 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}
  • 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}
  • GET /api/v1/versioning/hello
  • GET /api/v2/versioning/hello

When OpenAPI docs are mounted, the example also exposes:

  • GET /openapi.json
  • GET /docs

Errors are returned in a consistent JSON structure:

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