I've a PWA built using polymer 2.0 and polymerfire and is my web application. I've an express app acting as a cloud function (microservice).
Example: exports.register=functions.https.onRequest(app);
How to add the rewrite rules to map say /fns/register
and /fns/verify
to the above app register
.
I've updated my firebase.json
file in the cloudfunction microservice project, but when I run firebase deploy --only functions:register
it says there is no public folder for deploying the hosting configuration!
{
"hosting": {
"rewrites": [{
"source": "/fns/**", "function": "register"
}]
}
}
Maintaining the rewrite rules in the original web applicaiton could be one option, but still, is not ideal IMHO. If I've to do it in my original web application, I tried that as well, but couldn't make it. Following is my updated firebase.json
in my original web application:
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "build/default/public",
"rewrites": [
{
"source": "/fns/**",
"function": "register"
},
{
"source": "**",
"destination": "/index.html"
}
]
}
}