Spaces:
Runtime error
Runtime error
| import { Controller, Get, Render, Req, Res } from '@nestjs/common'; | |
| import { AppService } from './app.service'; | |
| import { Response } from 'express'; | |
| () | |
| export class AppController { | |
| constructor(private readonly appService: AppService) {} | |
| () | |
| root(() res: Response) { | |
| return res.render( | |
| "index", | |
| this.appService.getHome(), | |
| ); | |
| } | |
| ("/index") | |
| ('index') // Looks for views/index.ejs | |
| index() { | |
| return this.appService.getHome(); | |
| } | |
| } | |