Forked from mediavrog/gist:49c4f809dffea4e00738a7f5e3bbfa59
Created
September 12, 2017 06:56
-
-
Save martinabrahams/3646236ed8d978bbfa16a362d95e752d 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