firebase-hosting

Unable to add Firebase Dynamic Links to a project using a custom domain

对着背影说爱祢 提交于 2020-02-26 09:06:28
问题 I've created Firebase Dynamic Links in other projects before using the page.link URL prefix (the only option at the time). However that no longer appears to be an option when enabling Dynamic Links for a new project today. It looks like the docs for custom domains were updated today. Unfortunately, while they provide some helpful examples, they don't explain how to resolve my issue in a way that I can understand. So this message seems to indicate that I need to "Put links under a subpath". It

Firebase hosting and cloud functions don't work with formidable: incomingForm is not a constructor

戏子无情 提交于 2020-02-26 03:41:05
问题 I use express to handle post requests and formidable to parse uploaded files: import * as admin from "firebase-admin"; import * as functions from "firebase-functions"; import * as formidable from "formidable"; import * as util from "util"; import * as express from "express"; admin.initializeApp(); const app = express(); app.post("/image", (req, res) => { const form = new formidable.incomingForm(); form.parse(req, async function(err, fields, files) { res.writeHead(200, { "content-type": "text

Firebase hosting and cloud functions don't work with formidable: incomingForm is not a constructor

拜拜、爱过 提交于 2020-02-26 03:41:04
问题 I use express to handle post requests and formidable to parse uploaded files: import * as admin from "firebase-admin"; import * as functions from "firebase-functions"; import * as formidable from "formidable"; import * as util from "util"; import * as express from "express"; admin.initializeApp(); const app = express(); app.post("/image", (req, res) => { const form = new formidable.incomingForm(); form.parse(req, async function(err, fields, files) { res.writeHead(200, { "content-type": "text

How can I redirect my homepage to a random url through firebase hosting?

孤者浪人 提交于 2020-01-24 20:28:05
问题 I am trying to redirect my homepage with 302 redirect using firebase hosting. "redirects" :[{ "source": "/", "destination": "what do i put here?", "type": 302 } ] In my public folder, I have the index.html, 404.html, and a folder full of files. I would like for my homepage to randomly redirect to one of those files. I know you can redirect in the index.html with location.href/assign/replace, but I have to do it through 302 redirect. Thanks. 回答1: A possible alternative solution, involving

Different environments on Firebase web application

让人想犯罪 __ 提交于 2020-01-24 05:47:27
问题 I am building a web application with Firebase. Currently I can say that I do have two stages - development, the firebase serve which runs the localhost and firebase deploy --only hosting which uploads the web application on Firebase hosting. Everything is fine with that, but I do not see this as a professional solution. The problem that I see is that, my local environment and the live web application share the same database. I did quite some research on the topic and I understood that there

Auto config Firebase SDK in React

廉价感情. 提交于 2020-01-22 15:20:06
问题 I have a React app that I'd like to deploy to multiple environments (dev, staging, prod). each env is a separate Firebase project with its own config (apiKey, databseURL, etc). currently I hold multiple firebase-config.json for each env and use a switch in source code to determine which to use. I am using Firebase hosting for the app. The hosting docs state that I can fetch a special reserved url /__/firebase/init.json (or script in /__/firebase/init.js ) that firebase hosting prepares for

Configure redirects on Firebase Hosting SPA + 2 subfolders firebase.json

泪湿孤枕 提交于 2020-01-17 01:35:07
问题 I have a public folder like: /public index.html /landing index.html /membership index.html /public/index.html is a SPA, so each request to /** should me rewritten to /index.html /landing/ and /membership/ are two static HTML landings so each request should not be rewritten firebase.json suggested by Google support: { "functions": { "source": "functions" }, "hosting": { "public": "public", "redirects": [{ "source": "/landing", "destination": "index.html" }, { "source": "/membership",

How can we integrate Firebase Hosting with Firebase Realtime Database / Storage?

落花浮王杯 提交于 2020-01-15 10:28:58
问题 Now that Firebase provides Web Hosting services, how can we integrate Firebase Hosting with Firebase Realtime Database and Firebase Storage? 回答1: Firebase Hosting is static hosting for your web app.So you can use HTML, CSS, JavaScript. JavaScript Code: <script src="https://www.gstatic.com/firebasejs/3.5.0/firebase.js"></script> <script> // Initialize Firebase // TODO: Replace with your project's customized code snippet var config = { apiKey: "<API_KEY>", authDomain: "<PROJECT_ID>.firebaseapp

Firebase hosting : SSL Certificate has expired and haven't been renewed

旧城冷巷雨未停 提交于 2020-01-15 10:12:47
问题 Tonight our website https://guestme.live went down because an SSL issue. On my browser Chrome I get this error : NET::ERR_CERT_DATE_INVALID. Looking for the certificate provided by firebase hosting (from letsencrypt), the expiration date is 13 feb. 2017. Don't know why it hasn't be renewed and how to resolve this issue. I try to contact firebase support... Validity Not Before: Nov 15 22:08:00 2016 GMT Not After : Feb 13 22:08:00 2017 GMT 回答1: firebaser here This is a known problem that

Entering to my app hosted on firebase hosting redirects to google login page

半城伤御伤魂 提交于 2020-01-14 10:45:08
问题 Was tweaking with Server Side Rendering and google cloud functions. Deployed everything on hosting and something really strange happens. When I enter my page, https://accounts.google.com page appears... with some really long link: https://accounts.google.com/signin/v2/identifier? service=ah&passive=true&continue=https%3A%2F%2Fappengine.google.com %2F_ah%2Fconflogin%3Fcontinue%3Dhttps%3A%2F%2Fus-central1-treebase- b21-d5.cloudfunctions.net%2Fssrapp%2F&flowName=GlifWebSignIn&flowEntry=