Next.js Adapter
Use Filenest with the Next.js app router
Add Filenest to your Next.js API
This guide assumes you have already instantiated a provider.
If not, check out this section.
Initialize the adapter
Create the file route.ts
at /app/api/filenest/[...handler]/route.ts
.
If you like, you can choose a different directory.
Just make sure that you place the
Just make sure that you place the
route.ts
file in a folder called [...handler]
.This example is using the uploadthing provider as the data source.
Middleware
The use of middleware is strongly recommended to prevent unauthorized access to your provider.
- Return any HTTP error to prevent further code execution
- Execution will continue if you either return nothing or a
NextResponse
with a status of 200-299