title: How do I add Basic Authentication to Nextjs node server?
body: <p>I <strong>don't</strong> want to add authentication to some external request or OAuth. Just a server-side Basic Auth to the node server.</p>
  <p>As of writing Next.js doesn't seem to support it: <a href="https://github.com/vercel/next.js/discussions/17719" rel="noreferrer">https://github.com/vercel/next.js/discussions/17719</a></p>
  <p>It supports authentication but I guess it would have to be added to every single route of the app: <a href="https://nextjs.org/docs/authentication" rel="noreferrer">https://nextjs.org/docs/authentication</a></p>