-
Notifications
You must be signed in to change notification settings - Fork 122
Add extensions for super simple HTTP service application building #367
Comments
Hey, I saw this watching yesterday's standup today and think this is a brilliant idea. Can I suggest to add an overload which defines the handler as |
@dustinmoris yep agreed, would be nice to have that one too. Not sure about going all the way to just |
@kichalla can you work with folks on finalizing a design, and then implement? |
cc @rynowak |
@DamianEdwards - we already have a bunch of extensions with similar flavour on |
Done?? 😄 |
Too late to the party? How about adding support to DI in the lambda we pass to the extension method? Very similarly to what we already have when authoring a middleware
|
Some people want to have as little code as possible in a single file (
Program.cs
) to stand up very simple HTTP services (no, I won't say "micro-services").In other platforms (Go, Node, etc.) it's generally very easy to get an HTTP server up with some basic dispatching to various request-handling functions based on URL path. Doing this in ASP.NET Core today requires slightly more ceremony (Using
IApplicationBuilder
,RouteBuilder
, aStartup
class, etc.) but this can be very easily fixed with a couple of new extension methods in Routing.Super simple HTTP service application:
Extension methods we need to add to
Microsoft.AspNetCore.Routing
to make this work:The text was updated successfully, but these errors were encountered: