I have 2 subdomains configurated on firebase, myapp1.mydomain.cl and myapp2.mydomain.cl.
My default site url provided by Firebase are mydomain-1100.web.app
Im trying to deploy myapp1 into a subdomain with the following command
firebase target:apply hosting myapp1 myapp1.mydomain-1100
firebase deploy --only hosting:myapp1
When i do that, cli throw me the next error Error: HTTP Error: 404, Requested entity was not found.
This is my firebase.json
{
"hosting": {
"target": "myapp1",
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
What i'm doing wrong? i search for hours and i dont found a solution for my case,
i really appreciate constructive answers.
Related
while setting dns www.mydomain.com, something was wrong. and i delete my all custom domains
but my default domains(web.app, firebaseapp.com) redirected my old custom domain. with this error message
so, i register new custom domain but this error message
i see this problem 2 days ago
and my firebase.json file
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
I have an Angular web application called "my-app".
I created a project on Google Firebase and called it "my-app" as well.
I deployed the Angular application to Firebase project "my-app". As a result, a site "my-app-*****" appeared. My app was accessible on "my-app-*****.web.app" address.
Then I created the second site in Hosting of the same project. I called it "my-app-dev". It got an address but was empty because nothing was deployed yet.
I followed instructions from google: https://firebase.google.com/docs/hosting/multisites
And even one question on StackOverflow: Firebase hosting deploy to other site
I added targets and modified firebase.json. In the result, they looked like that:
firebase.json file content:
"hosting": [
{
"target": "prod",
"public": "www",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "dev",
"public": "www",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
.firebaserc file content:
{
"projects": {
"default": "my-app-*****"
},
"targets": {
"my-app-*****": {
"hosting": {
"dev": [
"my-app-dev"
],
"prod": [
"my-app-*****"
]
}
}
}
}
But I faced an error when I executed command firebase deploy --only hosting:dev
However, when I executed command firebase deploy --only hosting:prod, everything was deployed without errors.
As a result, I am able to deploy my project to "my-app-*****" site, but I could not deploy my project to "my-app-dev" site. I want both sites to use same built files, that is why "public" was pointing to the same directory "www". Both sites located in the same Hosting of "my-app" project on Google Firebase.
Can someone please help me and explain what have I done wrong?
This is my firebase.json file:
{
"hosting": {
"target": "md-viewer",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/",
"destination": "create_md.html"
},
{
"source": "/view/*",
"destination": "show_md.html"
}]
}
}
When running firebase serve, the rewrites work as expected. However, deploying and opening my app ("appname.firebaseapp.com") returns 404. The deployment is succesful since I can customize the 404 page, and access my files by asking for them directly (appname.firebaseapp.com/show_md.html, for example).
What's wrong? Shouldn't firebase serve mirror online behaviour?
If the "destination" key on the rewrite rule is a file, it has to be referenced with an absolute path:
"rewrites": [
{
"source": "/",
"destination": "/create_md.html"
},
{
"source": "/view/**",
"destination": "/show_md.html"
}]
Also, the "/view" rewrite needs two asterisks, according to the documentation.
Currently I have the below firebase.json. I wanna rewrite all requests of https://myapp.firebaseapp.com/api point to https://myapp.appspot.com/api (one of my app engine services). Somethink like the dispatch.yaml that appengine uses, how can I do that? I don't wanna use a DNS and a subdomain like api.xxxx.com/api
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/api**",
"destination": "https://myapp.appspot.com/api"
},
{
"source": "!/api/**",
"destination": "/index.html"
}
]
}
}
Firebase Hosting doesn't support rewriting paths to Google App Engine. Your rewrite options currently are:
Functions
Cloud Run container
Dynamic links
I am trying to upload an updated instance of a website to firebase that I pulled from my collaborator's github repo. I am getting the following error after I use command "firebase deploy":
=== Deploying to 'makany-webapp'...
i deploying hosting
Error: Specified public directory does not exist, can't deploy hosting
this is the firebase.json content:
{
"hosting": {
"public": "www",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/public/**",
"destination": "/public.html"
},
{
"source": "**",
"destination": "/index.html"
}
]
}
}
I am trying to deploy from the directory where the firebase.json resides. This same directory contains a "src" folder which contains the index.html file as well as other folder.
current directory and src directory
my bad. I had to change my src folder name to www