import { EggAppConfig , EggAppInfo , PowerPartial } from 'egg' ; import * as path from 'path' ; import * as fs from 'fs' ; export type DefaultConfig = PowerPartial < EggAppConfig > ; export default ( appInfo ) => { const config = { } as DefaultConfig ; config . keys = appInfo . name + '_1614320993440_7208' ; config . siteFile = { '/favicon.ico' : fs . readFileSync ( path . join ( __dirname , '../../favicon.ico' ) ) , } ; config . jwt = { secret : 'INnyQ50BEE6AITQraIaDGooJ' , } ; config . multipart = { mode : 'file' , } ; config . security = { csrf : { enable : false , ignoreJSON : true , } , } ; config . swagger = { title : 'sf-midway-admin' , description : 'sf-admin for midway api' , version : '0.0.1' , termsOfService : '' , contact : { name : 'API Support' , url : 'http://www.example.com/support' , email : 'support@example.com' , } , license : { name : 'MIT' , url : 'https://www.apache.org/licenses/LICENSE-2.0.html' , } , } ; config . middleware = [ 'adminReqLogMiddleware' , 'execptionMiddleware' , 'adminAuthMiddleware' , ] ; config . midwayFeature = { replaceEggLogger : true , } ; return config ; } ;