Munchable's maintenance switch: one boolean takes down database-backed routes only
Munchable is preparing a database migration and wants to avoid running it under live traffic. Before that, the developer built a maintenance switch, a single exported boolean constant that is flipped by hand and committed, rather than stored as an environment variable. The switch decides how each URL is handled: API routes, app routes behind login, and public pages, with public content such as recipes and guides staying online because it is prerendered at build time. The proxy checks the switch first and returns a maintenance response before making any call to the Supabase session service. The author also notes that prefix matching must respect whole path segments, so routes like /administration are not wrongly caught.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in