Created
September 15, 2018 13:36
-
-
Save acoyfellow/310a163a20d8144e8550ced85927651e to your computer and use it in GitHub Desktop.
CORS Node.js Google Cloud Function for returning Header information
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 cors = require('cors')({origin: true}); | |
exports.getHeaders= (req, res) => { | |
cors(req, res, () => | |
res.status(200).send({ ...req.headers }) | |
); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment