firebase-hosting

How to deploy an Angular 2 App using Firebase hosting?

落花浮王杯 提交于 2019-11-29 14:39:49
问题 I want to know the steps necessary to deploy a simple Angular 2 Application using Firebase-hosting. 回答1: These are the steps: 1) npm install -g firebase-tools This will install firebase CLI that we will use in the following steps. Firebase CLI requires Node.js version 0.10.0 or greater. 2) firebase init Project setup This will trigger Firebase project setup and store all settings in a local file firebase.json . ? What Firebase CLI features do you want to setup for this folder? Make sure

Firebase Serve command failing with error 404

…衆ロ難τιáo~ 提交于 2019-11-29 12:59:49
问题 Whenever I run firebase serve on my mac I am getting a 404 error...This has never happened before and I was just using the local dev server maybe 5 minutes before this started happening. I have deleted the firebase.json file and reinitialized it, reinstalled firebase tools but it fails every time. Here are the results from running the command in debug mode. firebase serve --debug [2018-09-11T16:12:25.873Z] ---------------------------------------------------------------------- [2018-09-11T16

Firebase hosting: Serve different pages from different custom domains

人走茶凉 提交于 2019-11-29 11:11:59
We're using custom domains on firebase hosting: our app, served from index.html, runs nicely on app.example.com. We've also connected www.example.com, which serves the app as well. The problem is: on www.example.com I want to be able to host a simple static page. Is there a way to configure this in the rewrites? We can easily output an extra html file in the deploy, next to index.html. Any ideas? Our firebase.json: { "database": { "rules": "database.rules.json" }, "hosting": { "public": "public", "rewrites": [ { "source": "**", "destination": "/index.html" } ] } } Firebase Hosting does not

Adding custom hosting domain: “Unexpected TXT records found. Continuing to watch for changes.”

六月ゝ 毕业季﹏ 提交于 2019-11-29 09:32:14
I'm attempting to add a custom domain to firebase hosting. Added the TXT records as instructed, and I get this message in the firebase dashboard: "Unexpected TXT records found. Continuing to watch for changes." There is one additional TXT record in my DNS settings, but I can't remove it. I don't see how it would get in the way of firebase's verification of my domain either. I'm using Namecheap if that helps. Thanks in advance! I had to make sure that for the host field, it was set to '@', and not my actual host name. I'm told this varies from registrar to registrar. Some require '@' for the

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

こ雲淡風輕ζ 提交于 2019-11-29 09:20:02
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": "public", "rewrites": [ { "source": "/url/:item", "destination": "/url/:item" } ] } } index.js file:

Firebase CLI: “Configure as a single-page app (rewrite all urls to /index.html)”

不羁的心 提交于 2019-11-29 05:26:51
I just used the Firebase CLI to init a static hosting project. What exactly happens when you enable the "configure as a single-page app" option? I'm looking for a description of exactly which files are modified, and what kind of effect this has on the Firebase backend. Frank van Puffelen That option simply sets a flag in the firebase.json file to redirect all URLs to /index.html . "rewrites": [ { "source": "**", "destination": "/index.html" } ] See the documentation of Firebase Hosting for more information. Full example: { "hosting": { "public": ".", "rewrites": [ { "source": "**",

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

[亡魂溺海] 提交于 2019-11-28 21:31:11
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. 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 = 'USERNAME' const PASSWORD = 'PASSWORD' const denyAccess = (res) => { res.statusCode = 401; res.setHeader('WWW

Hosting nodeJS app with firebase

非 Y 不嫁゛ 提交于 2019-11-28 21:30:26
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 files when hosting? Is it possible to tell Firebase, hey, run "node server.js" to host my index.html?

Firebase hosting: How to prevent caching for the index.html of an SPA

微笑、不失礼 提交于 2019-11-28 21:25:15
I'm hosting an SPA on firebase where almost all paths get rewritten to index.html . I'm using webpack hash based cache busting, so I want to always prevent caching of my index.html but not any other files. I'm finding it surprisingly difficult to do so. Specifically, my file layout looks like this / ├── index.html ├── login.html ├── js │ ├── login.ba22ef2579d744b26c65.bundle.js │ └── main.6d0ef60e45ae7a11063c.bundle.js └── public └── favicon-16x16.ico I started naively with "sources": "index.html" before reading this quote from the docs. Each definition must have a source key that is matched

Firebase hosting: Needs Setup

风流意气都作罢 提交于 2019-11-28 21:16:28
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 brennen I had the same problem, I was able to resolve it by toggling the DNS Status on cloudflare from DNS and HTTP Proxy (CDN) to just