Use Next.js with PostgREST effortlessly. Create a fully formed REST API in Next.js automatically.
Contents
Install
Use in a Route Handler
Query your Next.JS API
Adding a Swagger UI
You can use swagger-ui-react
to create API Docs automatically.
- Create a Swagger Client Component
- Use
NextPostgrestSwagger
in a React Server Component
- Visit your API Docs at http://localhost:3000/api-docs
Short circuiting with before
You can use before
to inspect the incoming request and return a new Response
.