I've just released my nextjs app to production using Vercel.
I'm loving the whole experience except for one tiny part: I would have loved to be able to put my app in maintenance mode, but this option does not seem available on Vercel.
My question is: Has anyone achieved this before and could share some details here?
I'm guessing it could be done at 2 levels:
- Modifying my app so that if an environment variable (i.e
MAINTENANCE_MODE=true
) is detected, every page redirects to a maintenance screen. However, this is not ideal, because adding an environment variable on Vercel requires a deployment for it to be taken into account. - Having a simple per-project toggle to enable/disable maintenance mode from Vercel. That would be mind-blowing.