import { EggRedisOptions } from 'egg-redis' ; import { TracerConfig , defaultTracerConfig } from '@mw-components/jaeger' ; import { ConnectionOptions } from 'typeorm' ; import { JwtConfig , JwtMiddlewareConfig , initialJwtMiddlewareConfig , } from '@mw-components/jwt' ; import { JwtAuthMiddlewareConfig } from './config.types' ; export const jwtConfig = { secret : '123456' , } ; export const jwtMiddlewareConfig = { ... initialJwtMiddlewareConfig , enableMiddleware : true , } ; jwtMiddlewareConfig . ignore = jwtMiddlewareConfig . ignore ?. concat ( [ '/auth/login' , '/ping' , '/genid' , '/genidHex' , /\/swagger-u.*/u , ] ) ; export const jwtAuth = { ignore : jwtMiddlewareConfig . ignore , redisScope : 'admin' , accessTokenExpiresIn : 60 * 60 * 24 * 3 , } ; export const orm = { type : 'mysql' , host : '127.0.0.1' , port : 3306 , username : 'root' , password : 'password' , database : 'shop_development' , synchronize : false , logging : true , } ; export const redis = { client : { port : 6379 , host : '127.0.0.1' , password : '' , db : 0 , } , } ; export const tracer = { ... defaultTracerConfig , whiteList : [ '/favicon.ico' , '/favicon.png' , '/ping' , '/metrics' ] , tracingConfig : { sampler : { type : 'probabilistic' , param : 1 , } , reporter : { agentHost : '127.0.0.1' , } , } , } ;