How to put a FIREBASE HOSTING site into maintenance mode? - firebase

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.

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.

You can also unroll your last deploy in one command.
Deploy maintenance page
Unroll when its done
Don't forget to send a 503 error for googlebot, asking it to come back in X hours.

Related

nextJS api routes not working with Firebase Hosting

I am having an issue with using Next.js API routes when deploying my website to Firebase Hosting. Here is the api call:
And here is the set up in the pages directory:
Here is the function used in email.js:
I changed the variables as to not give away my email address.
The call works when I use local host. However, when I build and deploy to firebase. I have tried to use the firebase url to make the api call, but I get a 404 page not found. I am not sure how to fix this. I would really appreciate any help.
Firebase hosting only hosts static files which is why your api routes don't work there. If you had a fully static Next site, you could host it on Firebase hosting. But if you want to use the api routes in Next, you need a server. One way to do this (albeit complicated) is to set up Firebase Functions with your api code and then rewrite requests in Firebase Hosting to that Firebase Function. It's complicated because it would require a fairly complex deploy process.
If the rest of your site is static, you can use Firebase Hosting for that and then consider ditching the api routes and instead setting up a Firebase Function to act as your api completely separate from Next.
Or if you want to keep it all in Next, consider something like Vercel for your site + api via Next.

is there any chance to host firebase app without their hosting

I have a question, so im currently building back-end less app with firebase( auth and database).
So, my question is how will work if my hosting is different(for example: superhosting.bg).If upload my app there,what should i need to run properly my app ?Can you explain me a little bit?
Firebase requires you to use Google servers. You cannot run firebase outside of Google's server-side environment. However, since you mentioned backendless (full disclosure - I am the founder), if you were to build your app with it, you can run it anywhere where Docker/Kubernetes runs.
Firebase Authentication and Realtime Database can be used from any hosting provider. There is no need to host your web site on Firebase Hosting. Just follow the setup instructions (ignoring the ones for Firebase Hosting), and you'll be good to go.
What do you actually want to transfer to superhosting.bg - you want to use a superhosting-owned domain to attach your app to or you want to use their hosting?
As Frank van Puffelen answered above, for the latter just follow bith platforms' instructions on set up. However, if you're already using firebase, I'd stick with that.
For using custom domain on superhosting with firebase, you need to add the TXT records shown in firebase to your DNS provider (superhosting). Essentially, you will need to edit the DNS Zone of your domain.
In superhosting this is done through their cPanel. Then you go to DNS zone editor and find the domain you want to edit. Once here, you have to option to add TXT registry.
To get this TXT registry, go to Add Custom Domain in firebase (docs here: https://firebase.google.com/docs/hosting/custom-domain). They'll give you a TXT code you copy in the aforementioned location in cPanel.
Et voila!

Deploy multiple Web Site to one Azure service

I am new to windows azure. I have requirement that I have to achieve. I have searched on the google but it was not useful.
I have to deploy multiple web sites to 1 cloud service. Is there any possibility? I will make them ssl enabled with multiple certificates in one cloud service.
So url's will be like:
https:// mysite/Home/
https:// mysite2/Home/
https:// mysite3/Home/
Actually my requirement is I should be able to deploy multiple web site and able to change the web.config after deployment. I think this we can do by enabling remote machine to the cloud service. After that we can login to remote machine and change the web.config file through iis manager. Am I correct?
Do we have any best way to achieve the requirement? I have to consider the minimum cost for this.
Thanks
This is an old post, but it shows how to run multiple websites in the same web role: http://www.wadewegner.com/2011/02/running-multiple-websites-in-a-windows-azure-web-role/
Regarding the changes in the web.config, you should not do that, because your instances may be changed, and those new instances will not have the modified file. All the configuration you are willing to change after deployment should be stored in the ServiceConfiguration.cscfg file. This way you can modify the configuration without redeploying, and the configuration is shared among all instances of the service.

Changing url name for web app

I am trying out Meteor, and every time I create and run a web app the url is localhost:3000; How do i change this url to whatever I want it to be?
for example, what would i do if I wanted the url of my web app to be www.gravity.com(random example)
Also, if I make a web app with meteor how do I add it to the chrome app store?
And finally, are there any good website to download free css website design templates?
* Sorry if I am asking a lot of "basic" questions, I have just started using meteor and I'm kind of a noob
When you make an app with meteor, you're making it on a local host. This means that the app is not up and running for everyone to see-- if someone else types in localhost:3000 from a different computer, your app will not pop up.
The easiest way to change this is to deploy with meteor--- meteor allows you to deploy to a website hosted on .meteor.com.
So if you want your url to be gravity.meteor.com, simply go to your project directory, and type
meteor deploy gravity.meteor.com
If that name isn't taken, you or anyone else can access your app there.
However, if you do not want it to say ".meteor.com", and instead just want www.gravity.com, you need to buy access to the domain www.gravity.com, and then deploy your app using a different method. You can buy a domain name from sites like godaddy.com. This is significantly harder than just deploying through .meteor.com. If that's something you want to do, here's a good tutorial on deploying using digital ocean.

Serving the static content of a Firebase app

From what I can infer from the Firebase docs, it seems that
a server is required to serve the static content (the html
and javascript), so you need to have a hosted machine and a
static content server up and running somewhere, or some service
to host a static site.
Is that correct ?
Throughout the Firebase site they repeatedly mention the
"no server needed" concept, so I was initially thinking
that Firebase did provide a mean to serve static content,
but there is no mention of it in the docs.
Did I miss something ?
UPDATE
Firebase does offer static hosting now, see link in answer below.
Firebase isn't a replacement for servers in every situation, but in some cases you can use Firebase instead of a server, or reduce server code you would otherwise have to write and maintain.
If you want to serve static HTML/CSS/JS to browsers great, but Firebase won't do it for you (you would at least need to jumpstart it). In this scenario you could serve assets on any cheap hosting site, but then make those traditionally static assets data-driven via Firebase without writing any server-side code.
The docs refer to "no server needed" scenarios because traditional web applications aren't the only use-case. You could build entire real-time mobile applications or browser extensions without hosting or serving anything yourself.
Firebase now offers hosting (in Beta) for your static asset files, so they are even more a "one stop shop".
https://www.firebase.com/docs/hosting.html

Resources