mirror of https://github.com/certd/certd
chore: env
parent
1e641b83c1
commit
96f9eab5cd
|
@ -14,8 +14,6 @@ const development = {
|
|||
port: 7001,
|
||||
},
|
||||
staticFile: {
|
||||
maxAge: 31536000,
|
||||
buffer: true,
|
||||
dirs: {
|
||||
default: {
|
||||
prefix: '/',
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
import { Controller, Get, Provide } from '@midwayjs/decorator';
|
||||
import { MidwayEnvironmentService } from '@midwayjs/core';
|
||||
import { Controller, Get, Inject, Provide } from '@midwayjs/decorator';
|
||||
import { logger } from '../utils/logger';
|
||||
import { Constants } from '../basic/constants';
|
||||
|
||||
@Provide()
|
||||
@Controller('/hello')
|
||||
export class HomeController {
|
||||
@Get('/')
|
||||
@Inject()
|
||||
environmentService: MidwayEnvironmentService;
|
||||
@Get('/', { summary: Constants.per.guest })
|
||||
async home(): Promise<string> {
|
||||
logger.info('当前环境:', this.environmentService.getCurrentEnvironment()); // prod
|
||||
return 'Hello Midwayjs!';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue