@HotValue(‘className:三年二班’)
private className: string;
apollo:{
client: {
appId: 'midway-apollo',
accessKey: '36104c4b15784a7b97708435ef97ee27',
// configPath: './config/apolloConfig.json',
namespaceList: ['application'],
configServerUrl: 'http://106.54.227.205:8080',
},
}
import * as apollo from 'midway-apollo'
@Configuration({
imports: [
...,
koa,
apollo,
...
],
importConfigs: [join(__dirname, './config')],
})
import { Controller, Get } from '@midwayjs/decorator';
import { Apollo } from 'midway-apollo'
@Controller('/')
export class HomeController {
@Apollo('age')
private age: string;
@Get('/')
async home(): Promise<string> {
return 'Hello Midwayjs!'+'apollo.age='+this.age;
}
}
因篇幅问题不能全部显示,请点此查看更多更全内容