Multiple domains with the same application using firebase as a backend

I want to create a one-page application, preferably with angular on the client and firebase as the backend. As for the general data warehouse, there is no need for advanced queries and there is no need for something like Mongodb together with the MEAN stack (which is most convenient for me otherwise). On the server side of firebase, there are sufficient requirements for what we want to build. My question is, and which seams are very difficult to find any information:

Can ** multiple domains be used with firebase running in the background, with the same application and database for each domain? ** (possibly using node as a static file server along with this if there is not enough base to deal with it). I mean, we want to be able to create the same system for our customers, but in their separate domains.

The goal is for the server-side application to work with the same backend logic with multiple websites and with angular to change the interface components depending on which area the user is visiting. (This has already been fixed and works correctly with angular).

I cannot find any information about this other than using multiple applications with the same domain. This is not what I intend to do. And firebase documentation doesn't help much. The possibilities of firebase hosting is the problem for me, and if someone can point me in the right direction, where to start, it would be very appreciated!

I looked for other alternatives when it comes to routing, for example, when using vhost middlevare with an explicit structure or Nginx to configure some kind of proxy server, but I believe that this is not necessary. or generally can be used with firebase. And I hope that there may be a more advanced approach.

Here is the active problem when using a proxy server with firebase: (Currently active: June 2016) https://github.com/firebase/firebase-tools/issues/155

Thank you, and I hope that it is appropriate to ask in this forum, otherwise, please let me know where I can find additional information about this.

+7
angularjs firebase
source share
1 answer

In the end, I found out what I needed to do, and now it works the way I need. Hope this helps if someone asks the same thing in the future.

In the firebase console, you can add allowed domains by clicking on the link:

https://console.firebase.google.com/project/THE_PROJECT_ID/authentication/providers and adding a set of domains to your application. (Initially, localhost and the firebase-app domain are set when the application is created)

enter image description here

and for testing purposes, installing hosts on GNU. (I am using mac.)

sudo nano /private/etc/hosts 

enter image description here

Now I can serve the same application: foo.com/10000 and bar.com/10001, as I wanted to do from the very beginning.

+8
source share

All Articles