|
@@ -5,7 +5,6 @@ import * as koa from '@midwayjs/koa';
|
|
|
import * as typegoose from '@midwayjs/typegoose';
|
|
|
import * as Typegoose from '@typegoose/typegoose';
|
|
|
import { ResponseMiddleware } from './middleware/response.middleware';
|
|
|
-import { IMidwayApplication, IMidwayContainer } from '@midwayjs/core';
|
|
|
@Configuration({
|
|
|
namespace: 'free',
|
|
|
imports: [koa, typegoose],
|
|
@@ -24,9 +23,9 @@ export class FreeConfiguration {
|
|
|
if (path)
|
|
|
console.log(`api文档: http://127.0.0.1:${port}${path}/index.html`);
|
|
|
}
|
|
|
- async onReady(container: IMidwayContainer, app: IMidwayApplication) {
|
|
|
+ async onReady() {
|
|
|
// TODO something
|
|
|
- app.getMiddleware().insertLast(ResponseMiddleware);
|
|
|
+ this.app.getMiddleware().insertLast(ResponseMiddleware);
|
|
|
Typegoose.setGlobalOptions({
|
|
|
schemaOptions: {
|
|
|
id: true,
|