@ResponseSet(headers) let you to configure response header from annotation.
@Controller("/calendars")
export class CalendarCtrl {
@Get("/:id")
@ResponseSet({"Content-Type": "application/json", status: 200})
public get(): ICalendar {
return <ICalendar> {id: request.params.id, name: "test"};
}
// or
@Get("/:id")
@ResponseSet("Content-Type", "application/json")
@ResponseSet("status", 200)
public get(): ICalendar {
return <ICalendar> {id: request.params.id, name: "test"};
}
}
Annotation's name is a proposal. If you have a better idea of name, tell-it !
@ResponseSet(headers)let you to configure response header from annotation.Annotation's name is a proposal. If you have a better idea of name, tell-it !