mirror of
https://github.com/certd/certd.git
synced 2026-04-14 04:20:52 +08:00
chore: env
This commit is contained in:
@@ -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!';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user