I've seen other stack overflow answers for using Firebase rewrites to route /api/** to their Express app function.
I'm following those instructions, but also trying to host a single page app.
Combining the two doesn't seem to work as the API routes are getting mapped to my index.html file still.
These are my rewrites
"rewrites": [
{
"source": "/api/**",
"function": "api"
},
{
"source": "**",
"destination": "/index.html"
}
]
Is this possible?
To answer your question, i've managed to do it by excluding /api/ from the single page app rules.
"rewrites": [
{
"source": "/api/**",
"function": "api"
},
{
"source": "!/api/**",
"destination": "/index.html"
}
]
Here we say :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With