From af1cc94d8e9d1be4a8b4dbdb3ff789e74469a7c9 Mon Sep 17 00:00:00 2001 From: CookieDasora Date: Sun, 3 Sep 2023 12:58:09 -0300 Subject: [PATCH] Updated CORS config --- .env.example | 1 + src/app.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index f5f00c1..50c155a 100644 --- a/.env.example +++ b/.env.example @@ -20,6 +20,7 @@ REDIS_PASSWORD= # Express SERVER_PORT= +CLIENT_URL= # Security JWT_ACCESS_SECRET= diff --git a/src/app.ts b/src/app.ts index f5c88bf..5f590a3 100644 --- a/src/app.ts +++ b/src/app.ts @@ -23,7 +23,7 @@ app.use(compression({ level: 9 })) app.use( cors({ credentials: true, - origin: '*', // TODO: Add client development (and production too) url + origin: process.env.CLIENT_URL, optionsSuccessStatus: 200, }), )