Created
July 5, 2022 17:52
-
-
Save sandeep1995/a2efb0f91a862dfc9b464520f6f16c76 to your computer and use it in GitHub Desktop.
Docswrite sub directory hostings for firebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.blog = functions.https.onRequest((request, response) => { | |
let url = new URL(request.url); | |
url.hostname = "blog.docswrite.blog"; // use your docswrite url | |
url.pathname = url.pathname.replace('/blog', ''); | |
fetch(url, request).then(d => d.text()).then(res => response.send(res)); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"hosting": { | |
// ... | |
// Add the "rewrites" attribute within "hosting" | |
"rewrites": [ { | |
"source": "/blog/*", | |
"function": "blog" | |
} ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment