Created
September 10, 2020 14:41
-
-
Save fredriccliver/d0cfcce68a6f75fdee21d838149fd8ec to your computer and use it in GitHub Desktop.
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") | |
const cors = require("cors") | |
exports.iowa = functions.region("us-central1").https.onRequest((req, res) => { | |
return cors()(req, res, () => { | |
res.send("Hi from Iowa, USA") | |
}) | |
}) | |
exports.london = functions | |
.region("europe-west2") | |
.https.onRequest((req, res) => { | |
return cors()(req, res, () => { | |
res.send("Hi from London, UK") | |
}) | |
}) | |
exports.hongkong = functions | |
.region("asia-east2") | |
.https.onRequest((req, res) => { | |
return cors()(req, res, () => { | |
res.send("Hi from Hongkong, Hongkong") | |
}) | |
}) | |
exports.seoul = functions | |
.region("asia-northeast3") | |
.https.onRequest((req, res) => { | |
return cors()(req, res, () => { | |
res.send("Hi from Seoul, Korea") | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment