So you just built a site with Astro, and now you need to lock it down. Maybe it is a work-in-progress for a client, or an internal tool you do not want indexed by search engines.
You could set up a VPN, configure nginx auth, or install an npm package. But those add complexity, extra config files, and more things that can break.
Astro has a built-in middleware system that runs whenever a page or endpoint is rendered, and HTTP Basic Authentication is a standard HTTP feature supported by every brow