My Blog

Study notes, programming tutorials, or simply food for thoughts.

Middleware in Next.js

The approaches without a custom server

Next.js recently released version 9, which added API Routes. This enabled us to write... well... APIs. This was a good excuse to move away from frameworks like Express as a custom server. Still, something was missing: Middleware. This is my attempt to replace it.

Develop Node app in ES6 without Nodemon and Babel

I recently started a new Node.js project, and as a habit, I began by installing two familiar packages: nodemon and babel. The purpose was that I needed a way to hot reload my app while writing it in ES6 Module.