sergeyt / Owin.Routing

Simple routing for OWIN applications inspired by express.js
MIT License
12 stars 4 forks source link

Allow to pass multiple AppFunc/HandlerFuncs to Get/Post/etc #21

Open VanCoding opened 8 years ago

VanCoding commented 8 years ago

In express, it's possible to pass multiple middleware functions to the get/post/etc functions, which then get called one after another. It works like this:

if you pass one function, it gets called with the next function of the parent middleware (as it works now). If you pass two functions, the first function gets called with the second function as next, and the second function gets called with the next function of the parent middleware.

So, every function gets called with the next function as "next" (obviously) and the last function gets called with the next function of the parent.

What do you think about adding this functionality to Owin.Routing aswell?

sergeyt commented 8 years ago

hi @VanCoding, now I don't have any interest to extend this package with any functionality since ASP.NET Core embeds Owin and such package is not needed anymore. Please feel free to send PR with this feature.

VanCoding commented 8 years ago

@sergeyt interesting. Does ASP.NET Core also include a router like this, or why is this package obsolete? Isn't the whole idea behind OWIN the ability to compose the application from different middlewares, like this router?

I've first looked at WebAPI 2, but when I've found out MS also introduced OWIN, I've considered it the much better alternative, as it seems much more flexible.

But I'm pretty new on this topic, as I'm currently forced to use C# for an application instead of Node.js . Did I maybe miss something important? I of course don't want to ride a dead horse :P

sergeyt commented 8 years ago

Does ASP.NET Core also include a router like this?

yes, but only declarative part with attributes, functional api could be easily ported too since there is similar IAppBuilder interface as in owin