Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect all requests to a Function or Cloud Run service without any public directory #3349

Closed
steren opened this issue May 8, 2021 · 1 comment · Fixed by #3351
Closed
Assignees

Comments

@steren
Copy link

steren commented May 8, 2021

I originally asked this question on Stackoverflow but I was advised by @mbleigh to open a Feature Request here.

I am using Firebase Hosting for many websites. Some websites have static files that I want to serve from Firebase Hosting static file serving, however, some others only have dynamic content for which I want to leverage Firebase's custom domain and caching.

It seems that the public attribute is required in firebase.json . This requires me to deploy a public folder with a dummy file in it.

It would be great to allow deploying to Firebase Hosting without any public directory,but with at least one function or run redirect.

The following gives me this error: Error: Must supply a public directory using "public" in each "hosting" config.

{
    "hosting": [
        {
            "target": "index",
            "public": "static",
            "rewrites": [
                {
                    "source": "**",
                    "destination": "/index.html"
                }
            ]
        },
        {
            "target": "api",
            "rewrites": [
                {
                    "source": "**",
                    "run": {
                        "serviceId": "api",
                        "region": "us-central1"
                    }
                }
            ]
        }
    ]
}
@qnxdev
Copy link

qnxdev commented Jul 23, 2021

How did you do that?

I'm getting a redirect to google login when I try to access custom-domain.com/function-name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants