API Routes
The server provides a clean structure for building your API routes, available in both full-stack and server-only setups.
New in v1.1.0: API routes are available in both full-stack and server-only projects. Enhanced middleware and security features included by default.
Health Check Route
A basic health check endpoint is available at `/api/health`.
| Route | Method | Description | Access |
|---|---|---|---|
| `/health` | `GET` | Check server health status. | Public |
Creating Your Own Routes
The route directory structure depends on your project setup:
- Full-Stack: Add routes in
server/src/routes/ - Server-Only: Add routes in
src/routes/
Register new routes in the main routes file: routes/index.js or routes/index.ts.
Built-in Security Features
- Helmet for security headers
- CORS configuration
- Rate limiting middleware
- Request compression
- Query sanitization
- Express validator integration