mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
cors, bug
This commit is contained in:
+15
-3
@@ -1,12 +1,24 @@
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
const PORT = 40557;
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
|
||||
await app.listen(PORT, '0.0.0.0');
|
||||
console.log(`http listening on port ${PORT}`)
|
||||
app.setGlobalPrefix('api')
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({
|
||||
transform: true,
|
||||
whitelist: true,
|
||||
forbidNonWhitelisted: true,
|
||||
forbidUnknownValues: true
|
||||
}),
|
||||
);
|
||||
app.enableCors();
|
||||
|
||||
await app.listen(process.env.PORT);
|
||||
console.log(`http listening on port ${process.env.PORT}`)
|
||||
}
|
||||
bootstrap();
|
||||
|
||||
Reference in New Issue
Block a user