Skip to content
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 primary associated type to HBRouterMethods #378

Merged

Conversation

sidepelican
Copy link
Contributor

I want to use it like Vapor's RouteCollection, so I need the primary associated type to be able to write the following

struct MyController {
    func boot(routes: some HBRouterMethods<MyRequestContext>) {
        routes.get("foo", use: getFoo)
        routes.post("foo", use: postFoo)
    }

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0b33c97) 84.51% compared to head (a11e337) 84.51%.
Report is 1 commits behind head on 2.x.x.

Additional details and impacted files
@@           Coverage Diff           @@
##            2.x.x     #378   +/-   ##
=======================================
  Coverage   84.51%   84.51%           
=======================================
  Files          95       95           
  Lines        5283     5283           
=======================================
  Hits         4465     4465           
  Misses        818      818           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough
Of course you can't add middleware, but then you probably shouldn't be allowed to as it would affect routes outside of the controller.

@adam-fowler adam-fowler merged commit 63cb413 into hummingbird-project:2.x.x Feb 12, 2024
4 checks passed
@sidepelican sidepelican deleted the hbroutermethods_add_pat branch February 13, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants