Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CORS solution
exports.handler = async function http(req) {
return {
body: '{ "ok": true }',
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
"Access-Control-Allow-Headers":
req.headers["access-control-request-headers"],
},
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment