From 2b810e59f963132b8d41bfaabacd4f3b6140f078 Mon Sep 17 00:00:00 2001 From: Matthew Stanciu Date: Wed, 13 May 2020 12:43:21 -0400 Subject: [PATCH] !!!!! cors !!!!! --- pages/api/join.js | 2 +- vercel.json | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pages/api/join.js b/pages/api/join.js index a1996cd8..bb17f7af 100644 --- a/pages/api/join.js +++ b/pages/api/join.js @@ -8,7 +8,7 @@ const joinTable = new AirtablePlus({ }) export default async (req, res) => { - res.setHeader('Access-Control-Allow-Origin', 'https://hackclub.com') + res.setHeader('Access-Control-Allow-Origin', '*') if (req.method === 'POST') { const data = JSON.parse(req.body) diff --git a/vercel.json b/vercel.json index 01eca470..82251764 100644 --- a/vercel.json +++ b/vercel.json @@ -6,5 +6,16 @@ }, "env": { "SLACK_BOT_TOKEN": "@slack-bot-token-production-8avf" - } + }, + "headers": [ + { + "source": "/api/join", + "headers": [ + { + "key": "Access-Control-Allow-Origin", + "value": "*" + } + ] + } + ] } \ No newline at end of file