Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martinabrahams/3646236ed8d978bbfa16a362d95e752d to your computer and use it in GitHub Desktop.
Save martinabrahams/3646236ed8d978bbfa16a362d95e752d to your computer and use it in GitHub Desktop.
CORS in Google Cloud Functions for Firebase
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