midwayjs / midway-component Goto Github PK
View Code? Open in Web Editor NEWmidway components
midway components
// 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提供配置可以设置路由前缀
没找到实现方案,希望支持,谢谢
import {Controller, Provide} from "@midwayjs/decorator";
@provide()
@controller('/api/v1/answers')
export class AnswerController {
//
}
会造成 swagger-ui/json 404.
翻了下源码,设置的这行还被注释了...
当验证对象里有 RuleType.object() 规则时,/swagger-ui/json 会报错:
object null is not iterable (cannot read property Symbol(Symbol.iterator))
debug 看了下是 joiSchema.$_terms?.keys
的值为 null
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.