Skip to content

Instantly share code, notes, and snippets.

@fredriccliver
Created September 10, 2020 14:41
Show Gist options
  • Save fredriccliver/d0cfcce68a6f75fdee21d838149fd8ec to your computer and use it in GitHub Desktop.
Save fredriccliver/d0cfcce68a6f75fdee21d838149fd8ec to your computer and use it in GitHub Desktop.
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