midwayjs-kinfe4j2
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

midwayjs swagger knife4j2

Example

访问地址: {host}/swagger-ui/index.html

示例图

Thanks to @nestjs/swagger

Usage

// configuration.ts
import * as swagger from 'midwayjs-knife4j2';

...

@Configuration({
  imports: [
    {
      component: swagger,
      enabledEnvironment: ['local', 'dev'],
    }
  ]
})
...

// xxx.controller.ts
import { ApiResponse } from 'midwayjs-knife4j2';

...
@Get('/overview')
@ApiResponse({
  status: 200,
  description: '控制台',
  type: WorkbenchDto,
})
async getOverview(): Promise<WorkbenchDto> {
  return this.workbenchService.getData();
}
...

this is a sub package for midway.

Document: https://midwayjs.org/docs/extensions/swagger

License

MIT

/midwayjs-kinfe4j2/

    Package Sidebar

    Install

    npm i midwayjs-kinfe4j2

    Weekly Downloads

    0

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    4.6 MB

    Total Files

    83

    Last publish

    Collaborators

    • fangbao