This is the accompanying code for the article How to Write Actual API Middleware for Next.js.
How to Write Actual API Middleware for Next.js
There are two separate implementations:
The demo apps were created by following the Next.js Getting Started guide.