Next.js Protect your API routes in Next.js with Middleware In this post, we will use the Next.js middleware feature to secure the API routes of a web application. Middleware has been released in Next.js 12