Enable cors

This commit is contained in:
Anthony Mineo 2020-08-29 19:32:50 -04:00
parent d85896dcaa
commit 86c531d61e
2 changed files with 6 additions and 2 deletions

View file

@ -66,7 +66,6 @@ export class GameService {
game.teams.obs.score += totalFlagScore;
game.teams.obs.players.push(p);
}
console.log(player.stats.dtTeamGame);
}
//const teamZero: any = game; //game.find(({ stats }) => stats.dtTeamGame[0] === '3');

View file

@ -7,6 +7,11 @@ import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors({
origin: [ /\.localhost$/, /\.playt2\.com$/ ],
credentials: true
});
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
@ -27,7 +32,7 @@ async function bootstrap() {
.build();
const document = SwaggerModule.createDocument(app, swaggerOptions);
SwaggerModule.setup('api', app, document);
SwaggerModule.setup('docs', app, document);
await app.listen(3000);
}