egg-shell-change

<img width="100" src="http://outt0i9l8.bkt.clouddn.com/egg-shell-decorators.png"/>

Usage no npm install needed!

<script type="module">
  import eggShellChange from 'https://cdn.skypack.dev/egg-shell-change';
</script>

README

egg-shell-change

这个项目是修改而来的 原来的项目是egg-shell-decorators, 但是似乎满足不了需求 所以我就增加了一些功能

添加了两个配置到了 swaggerOpt 里, 分别是

  • deprecatedRouters (弃用的路由)

    有一些路由其实已经弃用了 但是还没有删除,所以需要标记为弃用。但是egg-shell-decorators似乎没有提供这样的配置,所以我就增加了这个配置项, 使用方法在下面的Example里面

  • exceptionRouters (例外的路由)

Example

EggShell(app, {
    quickStart: true,
    swaggerOpt: {
      open: true,
      title: 'apis',
      description: 'project description',
      version: '1.0.0',
      host: 'api.ahs.wiki',
      port: 443,
      schemes: [ 'https' ],
      paths: {
        outPath: './app/public/swagger-ui/json/main.json',
        definitionPath: './app/definitions',
        swaggerPath: './app/swagger',
      },
      deprecatedRouters: [
        {
          path: '/user/forget-pwd',
          method: 'post'
        }
      ],
      exceptionRouters: [
        {
          path: '/user/login',
          method: 'post',
          detail: {} // swagger UI configs
        }
      ]
    },
  })