nextjs 13 protected api routes

What is the best way to protect api in the new nextjs release, something like an internal middleware?
6 Replies
Neto
Neto2y ago
app dir or pages dir?
Neto
Neto2y ago
Next.js API Routes | Clerk
Set up API routes to gather data into your Next.js app
Neto
Neto2y ago
but something like this
Filiberto
Filiberto2y ago
app dir, I just want to run a middleware on some endpoint to check if the user is authenticated or not
Neto
Neto2y ago
Neto
Neto2y ago
Check clerk example on that You can easily change that around what you need
Want results from more Discord servers?
Add your server