https://github.com/TheOne1006/egg-swagger
swagger-ui plugin for egg ,Demo:
https://github.com/TheOne1006/egg-swagger
egg egg-loopback egg-plugin egg-remote swagger-ui
Last synced: 10 months ago
JSON representation
swagger-ui plugin for egg ,Demo:
- Host: GitHub
- URL: https://github.com/TheOne1006/egg-swagger
- Owner: TheOne1006
- License: mit
- Created: 2017-09-17T10:31:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-23T22:25:30.000Z (about 3 years ago)
- Last Synced: 2024-02-14T23:35:13.048Z (about 2 years ago)
- Topics: egg, egg-loopback, egg-plugin, egg-remote, swagger-ui
- Language: HTML
- Homepage: http://egg-swagger-demo.herokuapp.com/explorer
- Size: 1.74 MB
- Stars: 26
- Watchers: 3
- Forks: 3
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
# egg-swagger
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]
[npm-image]: https://img.shields.io/npm/v/egg-swagger.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-swagger
[travis-image]: https://img.shields.io/travis/TheOne1006/egg-swagger.svg?style=flat-square
[travis-url]: https://travis-ci.org/TheOne1006/egg-swagger
[codecov-image]: https://img.shields.io/codecov/c/github/TheOne1006/egg-swagger.svg?style=flat-square
[codecov-url]: https://codecov.io/github/TheOne1006/egg-swagger?branch=master
[david-image]: https://img.shields.io/david/TheOne1006/egg-swagger.svg?style=flat-square
[david-url]: https://david-dm.org/TheOne1006/egg-swagger
[snyk-image]: https://snyk.io/test/npm/egg-swagger/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-swagger
[download-image]: https://img.shields.io/npm/dm/egg-swagger.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-swagger
egg plugin,support swagger-ui 2.0.
## Install
```bash
$ npm i egg-swagger --save
```
## Usage
```js
// {app_root}/config/plugin.js
exports.swagger = {
enable: true,
package: 'egg-swagger',
};
```
## Configuration
```js
// {app_root}/config/config.default.js
exports.swagger = {
enable: true,
mountPath: '/test-mount', // swagger-ui address /test-mount
swaggerFilePath: '/test-swagger.json', // swagger file default path
enableGoogleFont: false,
};
```
see [config/config.default.js](config/config.default.js) for more detail.
## Example
- [swagger-ui](http://petstore.swagger.io/?_ga=2.67112721.1460016005.1511156320-1698683464.1510724052) 对外开放 restful api
## Tips
搭配 可直接生成对应的 swagger 数据
## 依赖说明
swagger.json 规则来自于
## Questions & Suggestions
Please open an issue [here](https://github.com/TheOne1006/egg-swagger/issues).
## License
[MIT](LICENSE)