firebase-hosting

Firebase Dynamic Links subdomain config

◇◆丶佛笑我妖孽 提交于 2020-04-18 12:35:24
问题 Let's say I have a domain example.com . And I created a second website through hosting and cli as sub.example.com . { "hosting": [ { "target": "app", "public": "public", "rewrites": [ { "source": "**", "destination": "/index.html" } ] }, { "target": "promos", "public": "public", "appAssociation": "AUTO", "rewrites": [ { "source": "**", "dynamicLinks": true } ] } ] } Now when I go to create Dynamic Link for sub.example.com without any path prefix, it gives me a red flag saying: It looks like

Firebase Dynamic Links subdomain config

我怕爱的太早我们不能终老 提交于 2020-04-18 12:35:17
问题 Let's say I have a domain example.com . And I created a second website through hosting and cli as sub.example.com . { "hosting": [ { "target": "app", "public": "public", "rewrites": [ { "source": "**", "destination": "/index.html" } ] }, { "target": "promos", "public": "public", "appAssociation": "AUTO", "rewrites": [ { "source": "**", "dynamicLinks": true } ] } ] } Now when I go to create Dynamic Link for sub.example.com without any path prefix, it gives me a red flag saying: It looks like

Firebase hosting rewrite rules based on language of browser

泄露秘密 提交于 2020-04-18 03:51:31
问题 I have a Firebase hosted website that contains an index_fr.html and index_nl.html . How can I create a rewrite rules that uses the user agent language to serve the correct index_nl or index_fr page (without using Firebase functions)? 回答1: Firebase Hosting rewrites are based on the requested path only. There is not support for such conditional rewrites in the Firebase Hosting configuration. You might want to file a feature request for it. 来源: https://stackoverflow.com/questions/59251596

How to log errors with Firebase Hosting for a deployed Angular web app

假如想象 提交于 2020-04-15 10:51:09
问题 I am working on an Angular single page web app which uses Firestore as the database and will be deployed to Firebase Hosting. There seems to be no built-in way to log errors to the server or get run-time analytics unless you are developing an Android or iOS mobile app. I want to be able to view the web log files and find out about errors or abuse and see other typical live usage data. For example if the database code throws an error or a web API call returns an unexpected value and I catch

How to use sitemap in firebase hosting with react app

无人久伴 提交于 2020-04-11 06:23:25
问题 I have deployed a reactjs web app on my firebase hosting. I added a sitemap.xml file to the public folder. I edited firebase.json to route the source to sitemap.xml: "redirects": [ { "source": "/sitemap", "destination": "/sitemap.xml", "type": 302 } ], "rewrites": [ { "source": "/*", "destination": "/index.html" } ] But when ever I go https://blah blah.com/sitemap it always returns index.html I tried to add it to rewrites as well but it seems it always returns index.html . I am using React

Firebase - Request header field x-firebase-gmpid is not allowed by Access-Control-Allow-Headers in preflight response

懵懂的女人 提交于 2020-04-02 16:00:16
问题 My product uses firebase rtdb, firestore, storage, auth, and hosting. I didn't make any changes to my CORS configuration. However, today I started getting the following CORS error while trying to upload images to storage, and retrieve them: Access to XMLHttpRequest at 'https://firebasestorage.googleapis.com/v0/b/diary-a77f6.appspot.com/o?name=images%2FJ1gU3KPfo1cTHJXhT3iopBqrvVs1%2F-M1Ah4xCQ46GvEZtwgR1%2FBalboa%20Pier%2C%20California%20-%201600x1200%20-%20ID%2027253.jpg' from origin 'https:/

how to handle root path request with node.js on firebase hosting?

左心房为你撑大大i 提交于 2020-03-25 08:45:23
问题 I'm developing web system using firebase hosting + functions. Inspite of specifying rewrite rules on firebase.json, a part of routing doesn't work. root/  ├ functions/  │ ├index.js  │ ├routes/  │ │ └ index.js  │ └views/  │ ├ index.jade  │ └ sub.jade  └ public/ └index.html // this is created by default. I don't want to use this. This is my firebase.json "rewrites": [{ "source": "**", "function": "app" }], And this is node.js code. router.get('/', function(req, res, next) { res.render('index');

“no-referrer-when-downgrade error” Angular app on Firebase connecting to NGINX Jelastic

 ̄綄美尐妖づ 提交于 2020-03-05 06:07:03
问题 I have the following architecture: An Angular webapp hosted on Google Firebase (HTTPS) A jelastic environment with: An NGINX server (HTTPS) A Springboot 2 application server (HTTP) In order to work fine Firebase needs to use HTTPS API, so I added to the NGINX server an SSL certificate and a public IP. If I call the API using HTTP from postman the calls work fine. But if I call the API HTTPS from the Angular app in firebase than it doesn't work and I get this error: "Referrer Policy: no

“no-referrer-when-downgrade error” Angular app on Firebase connecting to NGINX Jelastic

北慕城南 提交于 2020-03-05 06:05:16
问题 I have the following architecture: An Angular webapp hosted on Google Firebase (HTTPS) A jelastic environment with: An NGINX server (HTTPS) A Springboot 2 application server (HTTP) In order to work fine Firebase needs to use HTTPS API, so I added to the NGINX server an SSL certificate and a public IP. If I call the API using HTTP from postman the calls work fine. But if I call the API HTTPS from the Angular app in firebase than it doesn't work and I get this error: "Referrer Policy: no

Firebase: Pass url Param in URL Rewrite

为君一笑 提交于 2020-02-29 18:34:10
问题 For the code examples in the firebase docs, it says to initiate a url rewrite like so: "hosting": { // Add the "rewrites" section within "hosting" "rewrites": [ { "source": "**", "destination": "/index.html" } ] } What do I do when I want to pass a parameter to the index page? I tried: "hosting": { // Add the "rewrites" section within "hosting" "rewrites": [ { "source": "/item/**", "destination": "/item.html?i=$1" } ] } But that doesn't do anything.. I have also tried the answer below: