[RFC] sub router
See original GitHub issueBackground
currently egg
don’t support sub router, but koa-router
provide prefix()
feature.
Proposal
- provide
app.namespace([prefix], [middlewares]).verb()
app.url()
will traverse all the router, return the first one
example:
// app/router.js
module.exports = app => {
app.get('/', 'home.index');
const adminRouter = app.namespace('/admin');
// GET /admin
adminRouter.get('/', 'admin.index');
// GET /admin/user
adminRouter.get('/user', 'admin.user');
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:16 (13 by maintainers)
Top Results From Across the Web
RFC 1812: Requirements for IP Version 4 Routers
1 INTRODUCTION An Interior Gateway Protocol (IGP) is used to distribute routing information between the various routers in a particular AS. · 2...
Read more >RFC 1812 Requirements for IP Version 4 Routers - IETF
The complete set of requirements for an Internet protocol router is primarily defined in the standard protocol specification documents, with the corrections, ...
Read more >OSPF Cost of the summary route with RFC 1583 and RFC 2328
-By default the routers implement the old RFC 1583, which means the cost of the summary route is. the lowest metric of the...
Read more >Blog - Layouts RFC | Next.js
Nested routes and layouts, client and server routing, React 18 features, and designed for Server Components.
Read more >[RFC]: Modal based routing · Issue #5890 · redwoodjs/redwood
I was actually trying to animate my modal sub-views (in my hacked together modal routing solution) to be able to slide between each...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/atian25/egg-router-plus/pull/1
写了个插件,下周再完善下
app.verb()
。