firebase-hosting

How do I exclude a path (/images) from single page app rewrite?

耗尽温柔 提交于 2019-12-22 10:28:10
问题 I have a react app and have the usual rewrite rule in firebase hosting: "rewrites": [ { "source": "**", "destination": "/index.html" } ] I also have a separate /images directory with images I don't want to be rewritten. How do I exclude the /images directory from the rewrite? 回答1: I'm a bit late but I found this question while searching for a similar problem. Use this rewrites rule : "rewrites": [ { "source": "!/images/**", "destination": "/index.html" } ] The key is that "source" (as a lot

Firebase Hosting mime type

时光毁灭记忆、已成空白 提交于 2019-12-22 07:35:11
问题 Has anyone found a way to set the mime type returned in the Content-Type header when hosting a file using Firebase Hosting? The docs say they support some headers in their rules file but not the content-type and I tied it anyway but fails the 'firebase deploy' due to error 'hosting.headers[0].headers[0].key is not one of enum values'. Also, the file i need to serve cannot have an extension which makes things harder for firebase to auto discover the type of the file. 回答1: I tested this and it

Port and Proxy Config on ng-build

半腔热情 提交于 2019-12-21 12:19:29
问题 I have a frontend running for example on int.myapp.com and it's backend on int.backend.myapp.com. I thought I can do the proxing with the proxy.config.json like this: "/api": { "target": "https://int.backend.myapp.com", "secure": true, "changeOrigin": true } And in my package.json file "start": "ng serve --proxy-config proxy.conf.json" Everything works on my dev environment. But when I build for production : ng buil --prod and deploy on firebase firebase deploy The web application is not able

Can I use Firebase Hosting to write a RESTful API in Node.js [duplicate]

不打扰是莪最后的温柔 提交于 2019-12-21 09:09:09
问题 This question already has answers here : Hosting nodeJS app with firebase (3 answers) Closed 2 years ago . Let's take for example the server.js Hello World var http = require("http"); http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.end("Hello World"); }).listen(80); How can I use it in Firebase ? Sorry for the duplicate but the answers were 3yo 回答1: (Update: Now the answer is: Yes, you can - see updates below) Original answer

Can I use Firebase Hosting to write a RESTful API in Node.js [duplicate]

佐手、 提交于 2019-12-21 09:08:02
问题 This question already has answers here : Hosting nodeJS app with firebase (3 answers) Closed 2 years ago . Let's take for example the server.js Hello World var http = require("http"); http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.end("Hello World"); }).listen(80); How can I use it in Firebase ? Sorry for the duplicate but the answers were 3yo 回答1: (Update: Now the answer is: Yes, you can - see updates below) Original answer

Firebase hosting with cloud functions - how to purge/refresh CDN cache?

不问归期 提交于 2019-12-21 05:16:09
问题 I'm following the instructions from this video and so far things are working perfectly right up to the point where I need to purge the CDN of old HTML: https://www.youtube.com/watch?v=7_2CJs_VZk4 So far I've created a static HTML page using Firebase Cloud Functions, and it is stored on Firebase Cloud Storage. Whenever data from my Firebase Database is updated, a new and updated static HTML page is rendered and is saved to the Cloud Storage. Firebase Hosting serves that static HTML page, and

How to update a file that I deployed to Firebase Hosting?

微笑、不失礼 提交于 2019-12-21 04:19:20
问题 On deploying my app to Firebase, I am getting this message: You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary! I learnt from a previous post that I need to replace the default index.html with my custom index.html . How do I do that using the Firebase Console? 回答1: You cannot change hosted files in the Firebase Console. Instead, you should change the index.html on your local copy where you initially ran the firebase deploy

Firebase hosting - force browser to reset cache on new deploys?

荒凉一梦 提交于 2019-12-20 17:41:12
问题 I have a site built with create-react-app and hosted on Firebase Hosting. What can I do to specify the browser cache needs to be updated after new deploys, and ideally only for pages, assets, and stylesheets that have been changed since the last deploy? Is there a way to access the deploy id and include that (or any other unique identifier) in the headers so the browser can compare to what it has in local storage or cache and determine whether a hard refresh is necessary? I looked over the

How to host nodeJS project to firebase?

大城市里の小女人 提交于 2019-12-20 10:27:07
问题 I am using node, express and more other dependencies for the project. I wonder how to host this project on firebase. My project will have controller, view , and any other folders to make the project possible.It already has view engine like pug/handlebars. Tutorials online only show how to host firebase with single index.html in public folder. How am I suppose to host my project with all other folders? I know how to use firebase in nodeJS, but how to host the project on firebase? How firebase

Firebase Hosting - Members Only / Secured Webpages? [duplicate]

孤人 提交于 2019-12-20 05:29:13
问题 This question already has answers here : Can Firebase hosting restrict access to resources? (2 answers) Closed 3 years ago . I understand that there are Realtime Database Rules which can be configured to restrict access to data at multiple levels. That's great. What about hosting? Are 'Members Only' webpages secured exclusively by the Realtime Database Rules? In other words, the client side Javascript could look at the firebase.auth().currentUser; properties to determine what form , table ,