mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
Attempt to fix CORS
This commit is contained in:
parent
db04ddb1ee
commit
8c1fdb3f62
2 changed files with 7 additions and 1 deletions
|
|
@ -7,6 +7,9 @@ const joinTable = new AirtablePlus({
|
|||
})
|
||||
|
||||
export default async (req, res) => {
|
||||
if (req.method == 'OPTIONS') {
|
||||
return res.status(204).json({ status: "YIPPE YAY. YOU HAVE CLEARANCE TO PROCEED." })
|
||||
}
|
||||
if (req.method == 'GET') {
|
||||
return res.status(405).json({ error: '*GET outta here!* (Method not allowed, use POST)' })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@
|
|||
"headers": [
|
||||
{
|
||||
"source": "/api/(.+)",
|
||||
"headers": [{ "key": "Access-Control-Allow-Origin", "value": "*" }]
|
||||
"headers": [
|
||||
{ "key": "Access-Control-Allow-Origin", "value": "*" },
|
||||
{ "key": "Access-Control-Allow-Methods", "value": "POST, OPTIONS" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue