/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
integration/send-files/src/app.controller.ts
44 строки
1 KB
Jay McDoniel
test: add test for res.destroyed handler
12 авг 2022, 23:41
12 авг 2022, 23:41
e82bdd4
Код
Авторство
О чём код?
import { Controller, Get, StreamableFile } from '@nestjs/common'; import { Observable } from 'rxjs'; import { AppService } from './app.service'; import { NonFile } from './non-file'; @Controller() export class AppController { constructor(private readonly appService: AppService) {} @Get('file/stream') getFile(): StreamableFile { return this.appService.getReadStream(); } @Get('file/buffer') getBuffer(): StreamableFile { return this.appService.getBuffer(); } @Get('non-file/pipe-method') getNonFile(): NonFile { return this.appService.getNonFile(); } @Get('file/rxjs/stream') getRxJSFile(): Observable<StreamableFile> { return this.appService.getRxJSFile(); } @Get('file/with/headers') getFileWithHeaders(): StreamableFile { return this.appService.getFileWithHeaders(); } @Get('file/not/exist') getNonExistantFile(): StreamableFile { return this.appService.getFileThatDoesNotExist(); } @Get('/file/slow') getSlowFile(): StreamableFile { return this.appService.getSlowStream(); } }