Examples
Simple API Example
A complete working REST API with CRUD operations, validation, and error handling. Copy and customize.
Complete Working Example
What This Does
- Creates a complete REST API with CRUD operations
- Uses Zod for validation and automatic type inference
- Implements standardized response patterns with a success boolean
- Type-safe throughout - TypeScript knows what's available
Key Features Highlighted
Type-Safe Validation
typescript
Standardized Responses
typescript
Try It Yourself
Scaffold a project with the CLI, drop this code into src/index.ts, and run it:
Test the API
GET http://localhost:3000/users
POST http://localhost:3000/users
GET http://localhost:3000/users/1