Creating a REST Endpoint
Last updated
Was this helpful?
Last updated
Was this helpful?
novel new api
You can use the scaffolding CLI to generate a rest endpoint for you. This is the easiest way to create a REST endpoint.
Follow the instructions and your new API should be in /app/api
.
You can generate OpenAPI schemas based on Fastify's validation and serialization model
This is automatically loaded into your route.
Because of Fastify's validation model, request input is already controlled on a framework level. If you prefer to validate further, you can make use of zod
internally like so:
You can apply authentication, throttling, and other tools via Novel's route directives.