diff --git a/src/main.ts b/src/main.ts index 3d1e0e0..ba714fa 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,7 +5,14 @@ import { writeFileSync } from 'fs'; import { AppModule } from './app.module'; async function bootstrap() { - const app = await NestFactory.create(AppModule); + const app = await NestFactory.create(AppModule, { + cors: { + origin: '*', + methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', + preflightContinue: false, + optionsSuccessStatus: 204, + }, + }); const config = new DocumentBuilder() .setTitle('Maestro Grpc Documentation') diff --git a/src/modules/inputs/inputs.controller.ts b/src/modules/inputs/inputs.controller.ts index 7940174..5d73d71 100644 --- a/src/modules/inputs/inputs.controller.ts +++ b/src/modules/inputs/inputs.controller.ts @@ -38,7 +38,7 @@ export class InputsController { } @Get() - async findAll() { + async findAll((@Body() body) { console.log(`/input`, 'ON FIND ALL ROUTE'); const inputService = new InputsService(this.inputsClientService); diff --git a/src/modules/inputs/inputs.service.ts b/src/modules/inputs/inputs.service.ts index ecf899e..11c101b 100644 --- a/src/modules/inputs/inputs.service.ts +++ b/src/modules/inputs/inputs.service.ts @@ -15,9 +15,9 @@ export class InputsService { } } - async findAll() { + async findAll(body) { try { - const findAllInputResponse = await this.inputClient.findAll({}); + const findAllInputResponse = await this.inputClient.findAll(body); return findAllInputResponse; } catch (err) {