This commit is contained in:
xiaojunnuo
2024-08-24 23:48:26 +08:00
parent c28f3cdcf7
commit 86ebbcb9bb
5 changed files with 62 additions and 21 deletions

View File

@@ -1,16 +0,0 @@
import { MidwayEnvironmentService } from '@midwayjs/core';
import { Controller, Get, Inject, Provide } from '@midwayjs/core';
import { logger } from '../utils/logger.js';
import { Constants } from '../basic/constants.js';
@Provide()
@Controller('/hello')
export class HomeController {
@Inject()
environmentService: MidwayEnvironmentService;
@Get('/', { summary: Constants.per.guest })
async home(): Promise<string> {
logger.info('当前环境:', this.environmentService.getCurrentEnvironment()); // prod
return 'Hello Midwayjs!';
}
}