Last active
May 22, 2019 20:58
-
-
Save rilian/dbc3ed86cf6b1365e1bdd4c2db469048 to your computer and use it in GitHub Desktop.
functions example for SO comment.
This file contains hidden or 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
I currently use https://us-central1-project-name.cloudfunctions.net/users/123 in production | |
and want to switch to using https://example.com/users/123 | |
Is there any way to workaround, or do you have any suggestions | |
to keep old URLs at *.cloudfunctions.net working for backwards compatibility ? | |
Otherwise default URL gets changed to https://us-central1-project-name.cloudfunctions.net/users/users/123 ... |
This file contains hidden or 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
const functions = require("firebase-functions"); | |
exports['users'] = functions.https.onRequest(require('users.js)); |
This file contains hidden or 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
const app = require("express")(); | |
app.get("/users/:id", (req, res) => { | |
// return user json by id | |
} |
This file contains hidden or 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
const app = require("express")(); | |
app.get("/:id", (req, res) => { | |
// return user json by id | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment