1.0.1 • Published 1 year ago

nest-knife4j v1.0.1

Weekly downloads
20
License
-
Repository
github
Last release
1 year ago

Usage

yarn add swagger-ui-express @nestjs/swagger nest-knife4j

in main.ts

import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'
import { knife4jSetup } from 'nest-knife4j'


async function bootstrap(){
  ...
    
  const options = new DocumentBuilder()
    .setTitle('Cats example')
    .setDescription('The cats API description')
    .setVersion('1.0')
    .addTag('cats')
    .build()
  const document = SwaggerModule.createDocument(app, options)
  SwaggerModule.setup('api', app, document)
  knife4jSetup(app, [
    {
      name: '2.X版本',
      url: `/api-json`,
      swaggerVersion: '2.0',
      location: `/api-json`,
    },
  ])
  await app.listen(3000)
  ...
}

then you can browse on http://127.0.0.1:3000/doc.html

示例

1.0.1

1 year ago

1.0.0

1 year ago

0.0.4

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago