From 5acdd83052b79602977a7c3ae3a92b13b86073c3 Mon Sep 17 00:00:00 2001 From: PCBZ Date: Tue, 22 Apr 2025 19:56:35 -0700 Subject: [PATCH] set cors --- Server/src/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Server/src/app.js b/Server/src/app.js index 5e1be685..153ae710 100644 --- a/Server/src/app.js +++ b/Server/src/app.js @@ -13,7 +13,12 @@ dotenv.config(); const app = express(); // middleware -app.use(cors()); +app.use(cors({ + origin: ['https://pcbz.github.io', 'http://localhost:3000'], + credentials: true, + methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'], + allowedHeaders: ['Content-Type', 'Authorization'] +})); app.use(express.json()); // routes