/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
integration/hello-world/src/hello/hello.controller.ts
33 строки
770 B
Kamil Myśliwiec
style(): run linter over packages, integration and spec files, add hook
29 ноя 2019, 11:24
Не верифицирован
29 ноя 2019, 11:24
c3f4ea3
Код
Авторство
О чём код?
import { Controller, Get, Header, Param } from '@nestjs/common'; import { Observable, of } from 'rxjs'; import { HelloService } from './hello.service'; import { UserByIdPipe } from './users/user-by-id.pipe'; @Controller('hello') export class HelloController { constructor(private readonly helloService: HelloService) {} @Get() @Header('Authorization', 'Bearer') greeting(): string { return this.helloService.greeting(); } @Get('async') async asyncGreeting(): Promise<string> { return this.helloService.greeting(); } @Get('stream') streamGreeting(): Observable<string> { return of(this.helloService.greeting()); } @Get('local-pipe/:id') localPipe( @Param('id', UserByIdPipe) user: any, ): any { return user; } }