Skip to content

Commit 56ced55

Browse files
author
Eamonn McEvoy
committed
docs(streamable-file): fix Response parameter in the eaxmple
1 parent 3b59d06 commit 56ced55

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

content/techniques/streaming-files.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ You can find a simple example of returning the `package.json` as a file instead
3434
> info **hint** If the @Response parameter is present, it must have `{{ '{' }} passthrough: true {{ '}' }}`.
3535
3636
```ts
37-
import { Controller, Get, StreamableFile } from '@nestjs/common';
37+
import { Controller, Get, StreamableFile, Response } from '@nestjs/common';
3838
import { createReadStream } from 'fs';
3939
import { join } from 'path';
4040

4141
@Controller('file')
4242
export class FileController {
4343
@Get()
44-
@Response({ passthrough: true }) res,
45-
getFile(): StreamableFile {
44+
getFile(@Response({ passthrough: true }) res): StreamableFile {
4645
const file = createReadStream(join(process.cwd(), 'package.json'));
4746
res.set({
4847
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)