chore: env

pull/21/merge
xiaojunnuo 2023-06-29 10:34:52 +08:00
parent 1e641b83c1
commit 96f9eab5cd
2 changed files with 8 additions and 4 deletions

View File

@ -14,8 +14,6 @@ const development = {
port: 7001, port: 7001,
}, },
staticFile: { staticFile: {
maxAge: 31536000,
buffer: true,
dirs: { dirs: {
default: { default: {
prefix: '/', prefix: '/',

View File

@ -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() @Provide()
@Controller('/hello') @Controller('/hello')
export class HomeController { export class HomeController {
@Get('/') @Inject()
environmentService: MidwayEnvironmentService;
@Get('/', { summary: Constants.per.guest })
async home(): Promise<string> { async home(): Promise<string> {
logger.info('当前环境:', this.environmentService.getCurrentEnvironment()); // prod
return 'Hello Midwayjs!'; return 'Hello Midwayjs!';
} }
} }