Skip to content

Commit 29b06d9

Browse files
committed
cors error backend fix
1 parent 0be7792 commit 29b06d9

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

client/vite.config.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,9 @@ export default defineConfig({
77
plugins: [react(), tailwindcss()],
88
base: "/PostPal-Intelligent-Photo-Selector/",
99
server: {
10-
headers: [
11-
{
12-
source: "/api/(.*)",
13-
headers: [
14-
{ key: "Access-Control-Allow-Origin", value: "https://post-pal-intelligent-photo-selector.vercel.app/" },
15-
{ key: "Access-Control-Allow-Methods", value: "GET, POST, OPTIONS" },
16-
{
17-
key: "Access-Control-Allow-Headers",
18-
value: "Content-Type, Authorization",
19-
},
20-
{ key: "Access-Control-Allow-Credentials", value: "true" },
21-
],
22-
},
23-
],
10+
headers: {
11+
"Cross-Origin-Opener-Policy": "same-origin-allow-popups",
12+
},
2413
cors: {
2514
origin: import.meta.env.VITE_BASEURL,
2615
},

0 commit comments

Comments
 (0)