Forked from mediavrog/gist:49c4f809dffea4e00738a7f5e3bbfa59
Created
September 14, 2019 04:02
-
-
Save ZhihaoLau/f92b2ee21061f2c0e3e88f1d092862b0 to your computer and use it in GitHub Desktop.
CORS in Google Cloud Functions 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
const cors = require('cors')({origin: true}); | |
exports.sample = functions.https.onRequest((req, res) => { | |
cors(req, res, () => { | |
res.send('Passed.'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment