diff --git a/api/src/app.ts b/api/src/app.ts index 6879eff..634ed5a 100644 --- a/api/src/app.ts +++ b/api/src/app.ts @@ -13,11 +13,14 @@ dotenv.config() const app = express() const { MODE, CORS, PORT_WEB } = process.env +const whiteList = [ + `http://localhost:${PORT_WEB ?? 3000}`, + 'https://sas.analytium.co.uk:8343/' +] + if (MODE?.trim() !== 'server' || CORS?.trim() === 'enable') { console.log('All CORS Requests are enabled') - app.use( - cors({ credentials: true, origin: `http://localhost:${PORT_WEB ?? 3000}` }) - ) + app.use(cors({ credentials: true, origin: whiteList })) } app.use(express.json({ limit: '50mb' }))