【发布时间】:2022-04-12 03:55:02
【问题描述】:
我有一个没有发回响应的控制器。
@Controller('/foo')
export class FooController {
@Post()
public async getBar(@Body() body: DTO, @Res() res) {
const response = await this.doSomething(body);
return response;
}
}
我不得不使用res.send 方法:
@Controller('/foo')
export class FooController {
@Post()
public async getBar(@Body() body: DTO, @Res() res) {
const response = await this.doSomething(body);
res.send(response);
}
}
【问题讨论】:
标签: nestjs