diff --git a/server-v2/config/cors.ts b/server-v2/config/cors.ts index 7a5e490..35e719d 100644 --- a/server-v2/config/cors.ts +++ b/server-v2/config/cors.ts @@ -20,7 +20,7 @@ const corsConfig: CorsConfig = { | you can define a function to enable/disable it on per request basis as well. | */ - enabled: false, + enabled: true, // You can also use a function that return true or false. // enabled: (request) => request.url().startsWith('/api') @@ -44,7 +44,17 @@ const corsConfig: CorsConfig = { | one of the above values. | */ - origin: true, + origin: (origin) => { + if (process.env.NODE_ENV === 'development') { + return true + } + + if (origin.includes('leaguestats.gg')) { + return true + } + + return false + }, /* |--------------------------------------------------------------------------