diff --git a/packages/hoppscotch-backend/src/main.ts b/packages/hoppscotch-backend/src/main.ts index 313bbfff..fb39809a 100644 --- a/packages/hoppscotch-backend/src/main.ts +++ b/packages/hoppscotch-backend/src/main.ts @@ -41,7 +41,7 @@ async function bootstrap() { const configService = app.get(ConfigService); - console.log(`Running in production: ${configService.get('PRODUCTION')}`); + console.log(`Running in production: ${configService.get('PRODUCTION')}`); console.log(`Port: ${configService.get('PORT')}`); checkEnvironmentAuthProvider( @@ -62,21 +62,20 @@ async function bootstrap() { }), ); - if (configService.get('PRODUCTION') === 'false') { - console.log('Enabling CORS with development settings'); - + if (configService.get('PRODUCTION') === 'true') { + console.log('Enabling CORS with production settings'); app.enableCors({ origin: configService.get('WHITELISTED_ORIGINS').split(','), credentials: true, }); } else { - console.log('Enabling CORS with production settings'); - + console.log('Enabling CORS with development settings'); app.enableCors({ - origin: configService.get('WHITELISTED_ORIGINS').split(','), + origin: true, credentials: true, }); } + app.enableVersioning({ type: VersioningType.URI, });