I am new to firebase functions. I am trying redirect functions under a new url instead of using default url from firebase functions.
My firebase.json looks like this. Is there a way to improve "rewrites"?
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"
},
"hosting": {
"cleanUrls": true,
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/.well-known/acme-challenge/wVJAlodX0whlzQQxznOSngFXGWFOLtsjk2F9l7oQDXc",
"destination": "/firebaseHostingVerification"
},
{
"source": "api/v1/currencies",
"function": "currencies"
},
{
"source": "api/v1/stop",
"function": "stop"
},
{
"source": "api/v1/track",
"function": "track"
},
{
"source": "api/v1/bookmark",
"function": "bookmark"
},
{
"source": "api/v1/authenticate",
"function": "authenticate"
},
{
"source": "api/v1/add-token",
"function": "addUserToken"
},
{
"source": "api/v1/update-history",
"function": "updateHistory"
},
{
"source": "api/v1/update-rates",
"function": "updateLatestRatesWithCodes"
},
{
"source": "api/v1/createMoneyChanger",
"function": "createMoneyChanger"
},
{
"source": "api/v1/moneyChanger",
"function": "moneyChanger"
},
{
"source": "api/v1/updateRates",
"function": "updateRates"
}
//
{
"source": "**",
"destination": "/index.html"
}
]
},
"database": {
"rules": "database.rules.json"
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"storage": {
"rules": "storage.rules"
}
}
Can I write it in such a way, whenever I add a new functions, it is will always be under my predefined url/function-name?