1.0.0 • Published 2 years ago

midway-test-component-new v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

midway 测试组件

包含路由,定时任务等。

使用方式

$ npm i midway-test-component --save

然后配置

import { Configuration } from '@midwayjs/decorator';
import { ILifeCycle } from '@midwayjs/core';
import * as test from 'midway-test-component';

@Configuration({
  imports: [
    test
  ]
})
export class ContainerConfiguration implements ILifeCycle {
  async onReady(): Promise<void> {
  }
}

效果

  • 1、路由访问 /test/hello,会输出 {data: 'hello world', query: {}}
  • 2、控制台会输出定时任务的字符串