cors trial 5

This commit is contained in:
taskylizard 2023-11-04 23:05:37 +05:30
parent 788dc1093a
commit 693c363f73
No known key found for this signature in database
GPG Key ID: 5CABA3D642DDC497
2 changed files with 8 additions and 2 deletions

View File

@ -47,7 +47,7 @@ async function handleSubmit(type?: string) {
method: "POST",
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST,PATCH,OPTIONS",
"Access-Control-Allow-Methods": "POST",
"Content-Type": "application/json",
},
body: JSON.stringify(body),

View File

@ -5,6 +5,12 @@ export default defineNitroConfig({
},
srcDir: ".vitepress",
routeRules: {
"/": { cors: false },
"/": {
cors: true,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST",
},
},
},
});