|
@@ -67,10 +67,15 @@ export class FreeConfiguration {
|
|
|
const port = this.app.getConfig()?.koa?.port;
|
|
|
if (path) console.log(`api文档: http://127.0.0.1:${port}${path}/index.html`);
|
|
|
}
|
|
|
+ getReqUri() {
|
|
|
+ const path = this.app.getConfig()?.koa?.globalPrefix;
|
|
|
+ const port = this.app.getConfig()?.koa?.port;
|
|
|
+ if (path) console.log(`api文档: http://127.0.0.1:${port}${path}`);
|
|
|
+ }
|
|
|
async onReady(container: IMidwayContainer) {
|
|
|
// TODO something
|
|
|
this.app.getMiddleware().insertLast(ResponseMiddleware);
|
|
|
- this.app.useFilter([CustomErrorFilter])
|
|
|
+ this.app.useFilter([CustomErrorFilter]);
|
|
|
// typegoose设置
|
|
|
Typegoose.setGlobalOptions({
|
|
|
schemaOptions: {
|
|
@@ -81,6 +86,7 @@ export class FreeConfiguration {
|
|
|
options: { allowMixed: Typegoose.Severity.ALLOW },
|
|
|
});
|
|
|
this.getApiUrl();
|
|
|
+ this.getReqUri();
|
|
|
// axios设置
|
|
|
const httpServiceFactory = await container.getAsync(axios.HttpServiceFactory);
|
|
|
const aos: object = this.app.getConfig('axios.clients');
|