Skip to content

Instantly share code, notes, and snippets.

@acoyfellow
Created September 15, 2018 13:36
Show Gist options
  • Save acoyfellow/310a163a20d8144e8550ced85927651e to your computer and use it in GitHub Desktop.
Save acoyfellow/310a163a20d8144e8550ced85927651e to your computer and use it in GitHub Desktop.
CORS Node.js Google Cloud Function for returning Header information
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