Replies: 1 comment
-
|
文件路由不会考虑自建,可能直接用 nextjs 的了 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The feature, motivation(功能、动机)
看到https://github.com/midwayjs/midway/issues/219 讨论分组路由的问题,最后给出的方案是使用动态添加 Web 控制器。虽然可以为同一目录下的控制器挨个添加路由,但是这样就放弃使用@controller,整体代码风格也变了。
能否添加一种方式,比如在同目录下的
index.ts文件,添加prefix配置export default {
routerPrefix: 'admin',
}
这样保证了装饰器风格一致,也没有破坏
IoC,路由也没有依赖文件夹而是依赖配置。Beta Was this translation helpful? Give feedback.
All reactions