Files
certd/packages/ui/certd-server/src/controller/basic/home-controller.ts
T

17 lines
547 B
TypeScript
Raw Normal View History

2023-06-29 10:34:52 +08:00
import { MidwayEnvironmentService } from '@midwayjs/core';
2024-07-15 00:30:33 +08:00
import { Controller, Get, Inject, Provide } from '@midwayjs/core';
2024-10-03 22:03:49 +08:00
import { logger } from '@certd/pipeline';
import { Constants } from '@certd/lib-server';
2023-01-29 13:44:19 +08:00
@Provide()
2024-08-24 23:48:26 +08:00
@Controller('/home')
2023-01-29 13:44:19 +08:00
export class HomeController {
2023-06-29 10:34:52 +08:00
@Inject()
environmentService: MidwayEnvironmentService;
@Get('/', { summary: Constants.per.guest })
2023-01-29 13:44:19 +08:00
async home(): Promise<string> {
2023-06-29 10:34:52 +08:00
logger.info('当前环境:', this.environmentService.getCurrentEnvironment()); // prod
2023-01-29 13:44:19 +08:00
return 'Hello Midwayjs!';
}
}