firebase-hosting

Cloud Functions for Firebase: 'Error: could not handle the request'

被刻印的时光 ゝ 提交于 2019-11-28 03:00:19
问题 I feel like pulling my hair out; this is either super simple and i'm having brain freeze or it is not that simple. What I want I am trying to unshorten a shortened URL using firebase, when a user goes to: myapp.firebaseappurl.com/url/SHORTENEDLINK SO wont let me add a shortened URL I would like the output to be: { "url": "https://stackoverflow.com/questions/45420989/sphinx-search-how-to-use-an-empty-before-match-and-after-match" } What I have tried firebase.json file: { "hosting": { "public":

Is it possible to require a password to access a site hosted on firebase?

百般思念 提交于 2019-11-27 20:45:49
问题 I'm hosting a site using firebase and want to be able to prevent people from accessing it, tried using a .htaccess file, wondering if anyone has been able to do it before. 回答1: Here is a little hack that simulates HTTP Basic authentication using firebase cloud functions and a little rearrangement of files. There are 3 steps to this: Set up the necessary cloud function Move the files you want to protect into a "secret" folder Update your firebase.json 1. Cloud Function const USERNAME =

Firebase hosting: Needs Setup

拈花ヽ惹草 提交于 2019-11-27 20:31:32
问题 I am trying to set custom domain for my firebase app Firebase hosted url : https://inventory-app-726af.firebaseapp.com/ Custom Domain: inv.agsft.com I have followed all instructions as part of setting custom domain but after verification step when I click on finish button, status will always be "Needs Setup". I am managing DNS through cloudflare (https://www.cloudflare.com/) and I am following Quick setup option. Any pointers to resolve it? Many Thanks Pari 回答1: I had the same problem, I was

Firebase not running index.html file

我只是一个虾纸丫 提交于 2019-11-27 15:41:39
问题 I'm a pretty new programmer going through the Firebase tutorial. I have gone through steps 1-5 of the tutorial (https://codelabs.developers.google.com/codelabs/firebase-web/#5). I've added the "Add Firebase to your web app" js code to the html file, and set up the Firebase CLI. However, when I run the firebase server, everything seems to work other than it is not showing the code from the index.html file. I am in the right directory, and my console says "Server listening at: http://localhost

How can I keep Google Cloud Functions warm?

寵の児 提交于 2019-11-27 14:47:38
I know this misses the point of using Cloud Functions in the first place, but in my specific case, I'm using Cloud Functions because it's the only way I can bridge Next.js with Firebase Hosting. I don't need to make it cost-efficient, etc. With that said, the cold boot times for Cloud Functions are simply unbearable and not production-ready, averaging around 10 to 15 SECONDS (WTF?) for my boilerplate. I've certainly watched this video by Google ( https://www.youtube.com/watch?v=IOXrwFqR6kY ) that talks about how to reduce cold boot time. In a nutshell: 1) Trim dependencies, 2) Trial & error

Hosting nodeJS app with firebase

余生颓废 提交于 2019-11-27 14:04:07
问题 So I have this web-app using angularJS and nodeJS. I don't want to just use localhost to demo my project because it doesn't looks cool at all when I type "node server.js" and then go to localhost..... Since I intend to use Firebase for the data, I have noticed that Firebase provides hosting. I tried it, but it seems to only host the index.html and not through/using server.js. I have customized files for the server to use/update. So, how can I tell Firebase Hosting to use my server and related

Filtering results with Geofire + Firebase

陌路散爱 提交于 2019-11-27 09:21:31
I'm trying to figure out how to query with filter with Geofire. Suppose I have restaurants with different category. and I want to add that category to my query. How do I go about this? One way I have now is querying the key with Geofire, run the for loop through each key and get the restaurant, and insert the appropriate restaurant to the array. These seems so inefficient. Is there any other way to go about this? Ideally I will have the filtered results, and only load each item when they're about to be shown. Cheers! Frank van Puffelen Firebase queries can only filter by one condition. Geofire

How can I securely store and retrieve API Keys for an android application (written in native Java) using Firebase Hosting?

自闭症网瘾萝莉.ら 提交于 2019-11-27 08:33:47
问题 I'm just starting to learn to code. Providing example code would be fantastic. I developed a simple android application (native Java) using Firebase. I have several API keys hard-coded into the resources of my application. I read that it is better to store these keys on a server. I currently do not have my own domain or server, but I am interested in using Firebase Hosting to store these API keys. I would appreciate some help setting up the foundation for storing and retrieving these API keys

Firebase Hosting with dynamic cloud functions rewrites

*爱你&永不变心* 提交于 2019-11-27 07:54:11
I have an express.js based cloud functions app on firebase in a function named api . To use a custom domain, I'm trying to use Firebase Hosting rewrites to route the specific URL to the function. I'm following the official documentation about cloud functions and Firebase hosting here, https://firebase.google.com/docs/hosting/functions , and have tried many combinations including the following: "rewrites": [ { "source": "/api/**", "function": "api" } ] "rewrites": [ { "source": "/api/:path1/:dat1/dat", "function": "api/:path1/:dat1/dat" } ] "rewrites": [ { "source": "/api/path1/dat1/dat",

Firebase Hosting on own server

隐身守侯 提交于 2019-11-27 07:42:00
问题 I am looking for a solution for developing iOS and Android chat to replace our current (unreliable, maybe poorly written by previous devs) XMPP/OpenFire chat. I came across Firebase which looks good. However, I don't quite get the setup for it. Can I host Firebase on my own server and not have to subscribe to any of Firebase's plans? 回答1: Firebase offers a few products: the Firebase realtime database Firebase hosting (for hosting static resources) Firebase authentication I think you are