We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a89b34c + 1f12632 commit c13efa7Copy full SHA for c13efa7
content/techniques/mvc.md
@@ -197,6 +197,17 @@ export class AppController {
197
}
198
199
```
200
+Alternatively, you can inject the `@Res()` decorator and response which view you want as follows:
201
+
202
+```typescript
203
+import { Res } from '@nestjs/common';
204
+import { FastifyReply } from 'fastify';
205
206
+@Get()
207
+root(@Res() res: FastifyReply) {
208
+ return res.view('index.hbs', { title: 'Hello world!' });
209
+}
210
+```
211
212
While the application is running, open your browser and navigate to `http://localhost:3000`. You should see the `Hello world!` message.
213
0 commit comments