template-rendering/src/app.controller.ts

14 lines
325 B
TypeScript
Raw Permalink Normal View History

2023-07-21 16:13:24 +08:00
import { Controller, Get, Render } from '@nestjs/common';
2023-07-21 15:53:21 +08:00
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) { }
@Get()
2023-07-21 16:13:24 +08:00
@Render('index.hbs')
getHello() {
return { message: 'Hello world!', fruit: ['apple', 'pear'] };
2023-07-21 15:53:21 +08:00
}
}