This commit is contained in:
xiaojunnuo
2025-01-19 01:07:20 +08:00
parent 5fc07d4dd4
commit 7f6d03c02a
9 changed files with 9 additions and 8 deletions
@@ -0,0 +1,15 @@
import { Controller, Get, Inject, MidwayEnvironmentService, Provide } from '@midwayjs/core';
import { logger } from '@certd/basic';
import { Constants } from '@certd/lib-server';
@Provide()
@Controller('/home')
export class HomeController {
@Inject()
environmentService: MidwayEnvironmentService;
@Get('/', { summary: Constants.per.guest })
async home(): Promise<string> {
logger.info('当前环境:', this.environmentService.getCurrentEnvironment()); // prod
return 'Hello Midwayjs!';
}
}