https://github.com/warriorbrian/node-knife4j
node knife4j
https://github.com/warriorbrian/node-knife4j
Last synced: 3 months ago
JSON representation
node knife4j
- Host: GitHub
- URL: https://github.com/warriorbrian/node-knife4j
- Owner: warriorBrian
- License: mit
- Created: 2023-04-20T15:50:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-20T17:13:07.000Z (about 3 years ago)
- Last Synced: 2025-08-09T12:14:27.526Z (10 months ago)
- Language: HTML
- Size: 3.42 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Usage
```bash
npm install @nestjs/swagger node-knife4j swagger-ui-express express
```
```js
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'
import { knife4jSetup } from 'node-knife4j'
async function bootstrap(){
...
const options = new DocumentBuilder()
.setTitle('knife4j example')
.setDescription('API description')
.setVersion('1.0')
.addTag('knife4j')
.build()
const document = SwaggerModule.createDocument(app, options)
SwaggerModule.setup('docs', app, document)
knife4jSetup(app, [
{
name: '1.x版本',
url: `/docs-json`,
swaggerVersion: '1.0',
location: `/docs-json`,
},
])
await app.listen(3000)
...
}
```
此版本采用`knife4j`最新版:`4.0.0`, 解决全局设置参数默认不携带问题等。