34 lines
715 B
TypeScript
34 lines
715 B
TypeScript
// backend/src/app.controller.ts
|
|
import { Controller, Get } from '@nestjs/common';
|
|
import { AppService } from './app.service';
|
|
|
|
@Controller()
|
|
export class AppController {
|
|
constructor(private readonly appService: AppService) {}
|
|
|
|
@Get()
|
|
getRoot() {
|
|
return {
|
|
message: 'DyoLink API',
|
|
version: '1.0',
|
|
endpoints: {
|
|
auth: '/api/auth',
|
|
docs: '/api/docs',
|
|
},
|
|
};
|
|
}
|
|
|
|
@Get('hello') // This will be at /api/hello
|
|
getHello(): string {
|
|
return this.appService.getHello();
|
|
}
|
|
|
|
/** Used by Docker / load balancer health checks (GET /api/health) */
|
|
@Get('health')
|
|
health() {
|
|
return {
|
|
status: 'ok',
|
|
timestamp: new Date().toISOString(),
|
|
};
|
|
}
|
|
} |