Examples
Each example is self-contained and demonstrates one specific feature. Click Open in StackBlitz to run it directly in your browser, or view the source on GitHub.
| # | Example | Feature | Config setting(s) | Links |
|---|---|---|---|---|
| 01 | Basic API | Zero-config CRUD for any resource | (none) | Source · |
| 02 | Resources | Restrict API to specific resource names | resources | Source · |
| 03 | Data Persistency | Persist data to a JSON file | connectionString | Source · |
| 04 | Schema Validation | Validate request bodies with JSON Schema | schemas | Source · |
| 05 | Filtering | Filter collections with query strings | (built-in) | Source · |
| 06 | Request Interceptor | Intercept requests (e.g. token auth) | requestInterceptor | Source · |
| 07 | Response Interceptor | Transform GET response bodies | responseBodyInterceptor | Source · |
| 08 | Etags | ETag caching and optimistic concurrency | etags | Source · |
| 09 | WebSockets | Real-time event broadcasting | webSocket | Source · |
| 10 | OpenAPI | Custom OpenAPI spec metadata | openapi | Source · |
| 11 | API Prefix | Add a path prefix to all routes | apiPrefix | Source · |
| 12 | CORS | Custom CORS configuration | cors | Source · |
All examples use the latest published version of Temba from npm. To run one locally:
cd "examples/01 - Basic API"
npm install
npm start