24 lines
507 B
TypeScript
24 lines
507 B
TypeScript
|
|
import { Controller, Get } from '@nestjs/common';
|
||
|
|
import { AppService } from '@/app.service';
|
||
|
|
|
||
|
|
@Controller()
|
||
|
|
export class AppController {
|
||
|
|
constructor(private readonly appService: AppService) {}
|
||
|
|
|
||
|
|
@Get('hello')
|
||
|
|
getHello(): { status: string; data: string } {
|
||
|
|
return {
|
||
|
|
status: 'success',
|
||
|
|
data: this.appService.getHello()
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get('health')
|
||
|
|
getHealth(): { status: string; data: string } {
|
||
|
|
return {
|
||
|
|
status: 'success',
|
||
|
|
data: new Date().toISOString(),
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|