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
app dir or pages dir?
Next.js API Routes | Clerk
Set up API routes to gather data into your Next.js app
but something like this
app dir, I just want to run a middleware on some endpoint to check if the user is authenticated or not
Configure Next.js Middleware | Clerk
Configure Clerk middleware for your Next.js application
Check clerk example on that
You can easily change that around what you need