mirror of https://github.com/certd/certd
chore: env
parent
1e641b83c1
commit
96f9eab5cd
|
@ -14,8 +14,6 @@ const development = {
|
||||||
port: 7001,
|
port: 7001,
|
||||||
},
|
},
|
||||||
staticFile: {
|
staticFile: {
|
||||||
maxAge: 31536000,
|
|
||||||
buffer: true,
|
|
||||||
dirs: {
|
dirs: {
|
||||||
default: {
|
default: {
|
||||||
prefix: '/',
|
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()
|
@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!';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue