Skip to content

[swagger]当在configuration.ts 添加全局路由前缀后, 生成的swagger文档中没包含路由前缀 #30

@jackie19

Description

@jackie19
// configuration.ts  onReady
      this.app.use(async (ctx, next) => {
        if (!ctx.path.startsWith('/api')) {
          ctx.status = 404;
          ctx.set('Content-Type', 'text/html; charset=utf-8');
          ctx.body = '<h1>404 Not Found...</h1>';
          return;
        } else {
          ctx.path = ctx.path.replace('/api', '');
        }
        await next();
      });

希望swagger提供配置可以设置路由前缀

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions