when I visit: http://localhost:3000/api/user/all?id=123
the result is '{"id":"all","flag":"getOne"}',but there is a Error: Can't set headers after they are sent.
why will Method:getAll be executed when Method:getOne return a result?
import {Controller, JsonResponse, Param, Get, QueryParam} from "routing-controllers";
@Controller('/user')
export class UserController {
@Get("/:id")
@JsonResponse()
getOne(@Param("id") id:string) {
console.log('getOne');
return {id:id,flag:'getOne'};
}
@Get("/all")
getAll(@QueryParam("id") id:number) {
console.log('getAll');
return {id:id,flag:'getAll'};
}
}