resources/<name>/endpoints/ — no manual route files needed. All routes pass through global middlewares before reaching their handlers.
Request Flow
Auto-Discovery
Routes register automatically. Each file inresources/<name>/endpoints/ that default-exports createEndpoint({...}) is mounted at /<name>/<path>.
resources/projects/endpoints/list.ts
- Resource name = URL prefix:
resources/projects/→/projects/* - No manual registration — just place files in
endpoints/ - Check startup logs for:
[routes] METHOD /resource/path
Auth Default
Every endpoint requires authentication unlessisPublic is in the middlewares array. isPublic is a sentinel reference — the route system checks middleware === isPublic by identity.
isAdmin middleware which checks the x-admin-key header against config.ADMIN_KEY.
Authentication Flow
See Also
- Routing Middlewares - Global and route-specific middlewares
- API Actions - Creating resource endpoints
- Middlewares - Validation and rate limiting
