20 lines
536 B
TypeScript
20 lines
536 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
import { Logger } from '@nestjs/common';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
|
|
if (process.env.NODE_ENV == 'production') {
|
|
app.enableCors({
|
|
credentials: true,
|
|
origin: ['https://shows.everest.tailscale/admin/'],
|
|
});
|
|
} else {
|
|
const logger = new Logger("bootstrap")
|
|
logger.log("In development mode, not enabling CORS")
|
|
}
|
|
|
|
await app.listen(process.env.PORT);
|
|
}
|
|
bootstrap();
|