/egg-swagger

swagger-ui plugin for egg ,Demo:

Primary LanguageHTMLMIT LicenseMIT

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

Questions & Suggestions

Please open an issue here.

License

MIT