-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new route functions (...WithExtensions) + .NET 8 and 9 #634
base: master
Are you sure you want to change the base?
Conversation
update fsharp-analyzers version
fantomas lint samples/RateLimiting remove routeWithExtensions from /no-rate-limit endpoint
@@ -156,29 +157,71 @@ module Routers = | |||
| CONNECT -> "CONNECT" | |||
| _ -> "" | |||
|
|||
[<RequireQualifiedAccess>] | |||
type AspNetExtension = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan the DU. This means if someone wants to extend this functionality they have to edit giraffe source code. And if they're doing something custom it's not something we'd want to accept.
It would be better to have a list of IEndpointConventionBuilder -> IEndpointConventionBuilder/unit
functions and maybe provide helpers for known ones we'd want to support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From afar this looks good, I agree with Jimmy his comment.
Description
With this PR, I'm adding a new alpha endpoint routing functions based on what was presented at PR #619. The new routing functions are:
routeWithExtensions
routefWithExtensions
subRouteWithExtensions
There is a new sample showing how to use it with ASP.NET's Rate limiting middleware, a new docs section was added to explain this new feature and more unit tests were added.
As a side-effect of this new feature, the minor .NET version was bumped to 8.0, so some packages were updated accordingly. CI as well.
In the long run my plan is to add new extensions and improve the ones we currently have (this is in alpha as explained by the docs).
How to test
Related issues