Skip to content

Commit 16f8bed

Browse files
author
Eamonn McEvoy
committed
docs(streaming-files): fix response parameter position
1 parent e4b25d6 commit 16f8bed

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
@@ -51,15 +51,14 @@ The default content type is `application/octet-stream`, if you need to customize
5151
> info **hint** If the @Response parameter is present, it must have `{ passthrough: true }`.
5252
5353
```ts
54-
import { Controller, Get, StreamableFile } from '@nestjs/common';
54+
import { Controller, Get, StreamableFile, Response } from '@nestjs/common';
5555
import { createReadStream } from 'fs';
5656
import { join } from 'path';
5757

5858
@Controller('file')
5959
export class FileController {
6060
@Get()
61-
@Response({ passthrough: true }) res,
62-
getFile(): StreamableFile {
61+
getFile(@Response({ passthrough: true }) res): StreamableFile {
6362
const file = createReadStream(join(process.cwd(), 'package.json'));
6463
res.set({
6564
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)