Skip to content

Instantly share code, notes, and snippets.

@otbe
Last active July 13, 2016 04:09
Show Gist options
  • Select an option

  • Save otbe/5ce00a2a1d22a28c30f016ad2bd8b1d8 to your computer and use it in GitHub Desktop.

Select an option

Save otbe/5ce00a2a1d22a28c30f016ad2bd8b1d8 to your computer and use it in GitHub Desktop.
interface Cookies {
read(name: string): string;
write(name: string, value: string, options?: CookieOptions);
}
interface SetStatus {
(code: number): void;
}
@ApiController('/users')
@Produces('text/html')
class TestController {
@Get('/')
@Produces('application/json');
getUsersAsJson(@Cookies cookies: Cookies,
@Header('content-type') contentType: string,
@Status setStatus: SetStatus): Promise<Array<User>> {
// specific implementation
return userService.list();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment