Nextjs, React, Localization, Routing, Web Development.
if you add a console.log in the middleware, you will see multiple logs every time a route changes. This is because the middleware is invoked for every route in your project. So, if you want to define specific paths the middleware should run on, read about Matching Paths. The config in the example