Starting the server
| Command | Behavior |
|---|---|
npm run dev | Starts the server with tsx watch. The process automatically restarts on file changes. Use this during local development. |
npm run start | Runs the compiled output from dist/ with NODE_ENV=production. Build first with npm run build or npm run esbuild. |
The server listens on port 3000. Make sure this port is available before starting.
Base path
All API routes are mounted under:Health check
Use the health endpoint to verify the server is running. This route does not require authentication.Authentication
All routes under/api/v1 — except /api/v1/health — require a valid Supabase JWT passed as a Bearer token in the Authorization header.
A Supabase JWT obtained from your Supabase project’s Auth service.Format:
Bearer <token>supabase.auth.getUser(token). Requests with a missing, malformed, or invalid token receive a 401 Unauthorized response.
Example request
CORS
CORS is enabled globally via@elysiajs/cors. All origins are permitted by default. To restrict allowed origins for production, configure the CORS plugin options in src/index.ts.