import { NestFactory } from "@nestjs/core";
import { ValidationPipe } from "@nestjs/common";
import { AppModule } from "./app.module";

async function bootstrap() {
  const app = await NestFactory.create(AppModule, { rawBody: false });
  app.enableCors({ origin: true });
  app.useGlobalPipes(
    new ValidationPipe({ whitelist: true, transform: true }),
  );
  const port = parseInt(process.env.PORT || "8090", 10);
  await app.listen(port);
  // eslint-disable-next-line no-console
  console.log(`hubee-wpp sync listening on :${port}`);
}

bootstrap();
