1.2.2 • Published 4 years ago

egg-swagger v1.2.2

Weekly downloads
104
License
MIT
Repository
github
Last release
4 years ago

egg-swagger

NPM version build status Test coverage David deps Known Vulnerabilities npm download

egg plugin,support swagger-ui 2.0.

Install

$ npm i egg-swagger --save

Usage

// {app_root}/config/plugin.js
exports.swagger = {
  enable: true,
  package: 'egg-swagger',
};

Configuration

// {app_root}/config/config.default.js
exports.swagger = {
  enable: true,
  mountPath: '/test-mount', // swagger-ui  address  <domain>/test-mount
  swaggerFilePath: '/test-swagger.json', // swagger file default path
  enableGoogleFont: false,
};

see config/config.default.js for more detail.

Example

Tips

搭配 https://github.com/TheOne1006/egg-connector-remote 可直接生成对应的 swagger 数据

依赖说明

swagger.json 规则来自于 https://editor.swagger.io/?_ga=2.41951072.471192285.1510301833-940518916.1510301833#/

Questions & Suggestions

Please open an issue here.

License

MIT

1.2.2

4 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago