Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put a FIREBASE HOSTING site into maintenance mode?

I have a Vue.js app and use Firebase Hosting to serve the static files to users.

Does Firebase Hosting have a method for putting the app into maintenance mode remotely? Without having to do firebase deploy

Maybe something that will allow me to redirect all the traffic to some other index.html, and be able to manage it from Firebase.

P.S. I've already looked into Firebase Remote Config (and it doesn't fit my use case, and their web related tools aren't fully implemented yet). And I'd like to avoid having a realtime database just for maintenance mode.

like image 408
Artur Grigio Avatar asked Nov 06 '18 00:11

Artur Grigio


People also ask

How do I make changes in a website that is hosted in firebase?

You cannot change hosted files in the Firebase Console. Instead, you should change the index. html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.

Is firebase Hosting static?

Firebase Hosting is a fully-managed hosting service for static and dynamic content as well as microservices. The service is backed by SSD storage and a global CDN (content delivery network). Zero-configuration SSL is built into Firebase Hosting, so content is always delivered securely.

Is firebase Hosting backend?

Firebase is a Backend-as-a-Service — BaaS — that started as a YC11 startup and grew up into a next-generation app-development platform on Google Cloud Platform.


2 Answers

There is no mode-switch built into Firebase Hosting for temporarily serving other content.

But given the recent updates to deploy efficiency, it should be pretty low-cost to put up a temporary index.html while making the changes. Alternatively, you could deploy rules (in firebase.json) that temporarily redirect all traffic to a wip.html (for work-in-progress).

Which of these works best, depends on your current content structure. I.e. if you already redirect "all" traffic to index.html, I'd probably go with a rewriting solution.

like image 174
Frank van Puffelen Avatar answered Nov 02 '22 22:11

Frank van Puffelen


You can also unroll your last deploy in one command.

  1. Deploy maintenance page
  2. Unroll when its done

Don't forget to send a 503 error for googlebot, asking it to come back in X hours.

like image 45
Denis TRUFFAUT Avatar answered Nov 02 '22 23:11

Denis TRUFFAUT