Do you have any plans for supporting koa@2 and make using more convenient?
See original GitHub issueHi.
Trie-router is the official router and I think we could give second breath to it.
Proposal \ my vision
Requirements
- It should works with node 7.x.x and higher
- It should support only koa@2 and higher
- It should be mountable
- It should be powerful as it is now
API
-
Instantiation should requires
new
operator (like Koa@2)let router = new Router();
-
Routers could be define like
router[use|get|post|put|del|patch]([path], [...middleware]);
- where path & middleware both optional but it requires at least one of them
- path is
{String|{Array<String>}
- middleware is
{Function|AsyncFunction|Array<[Function|AsyncFunction]>}
-
Router should implements
router.middleware()
likekoa.middleware()
for mounting (composing) -
ctx.params
like https://github.com/koajs/trie-router/tree/1.1.0#thisparams
What do you think about it?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Awesome Koa.js Web Framework - GitHub
You can find the Testfiles on travis-deadlink-scanner. Links. Koa - Expressive middleware for node.js using generators; co - The ultimate generator based flow- ......
Read more >Building A Server-Side Application With Async Functions and ...
In this article, I would like to show you a very practical example of building a server-side application using Koa 2, a new...
Read more >How To Build a "Hello World" Application with Koa
In this article, you will learn more about the Koa framework and build an app to get familiar with its functionality and philosophy....
Read more >Is Express the Best Option? - Medium
Many beginners are more comfortable using Express because it is unopinionated or less abstracted from Node, meaning it is more similar to ...
Read more >How to create Koa2 middleware which will modify response ...
body.toUpperCase(); }) // template rendering app.use(async function (ctx, next) { ...
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
thanks for your work. your changes sound good. you can publish, but I would hold off with tagging the
koa@2
version aslatest
until I (or someone else) publishes koa@2 this weekend.let me know if u you need npm rights
Done https://github.com/koajs/trie-router/releases/tag/2.1.0