Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jackie19 opened this issue May 14, 2021 · 1 comment
Assignees

Comments

@jackie19
Copy link

jackie19 commented May 14, 2021

// 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提供配置可以设置路由前缀

@jackie19 jackie19 changed the title [swagger]当在configuration.ts 添加全局路由前缀后, 生成的swagger文档中不包含路由前缀 [swagger]当在configuration.ts 添加全局路由前缀后, 生成的swagger文档中没包含路由前缀 May 14, 2021
@czy88840616 czy88840616 self-assigned this Sep 10, 2021
@czy88840616
Copy link
Member

对,这个相当困难。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants