-
Notifications
You must be signed in to change notification settings - Fork 399
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 prefix method to Route
/Routes
#2547
Conversation
29413a0
to
ecfe87b
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2547 +/- ##
==========================================
- Coverage 64.28% 64.22% -0.06%
==========================================
Files 138 138
Lines 7977 7987 +10
Branches 1483 1471 -12
==========================================
+ Hits 5128 5130 +2
- Misses 2849 2857 +8 ☔ View full report in Codecov by Sentry. |
@@ -120,6 +119,16 @@ sealed trait Route[-Env, +Err] { self => | |||
*/ | |||
def location: Trace | |||
|
|||
def prefix(prefix: PathCodec[Unit])(implicit ev: Err <:< Response): Route[Env, Err] = |
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.
Shouldn't this be called nest
, because it nests routes under a path prefix?
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 think what you say is not wrong, but I find prefix more intuitive. Akka http calls it pathPrefix
in their routing api, play has SimpleRouter#withPrefix
. I think prefix is quite right.
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.
One tiny comment on naming, otherwise looks great!
7adf00f
to
0bed16a
Compare
0bed16a
to
d30f311
Compare
No description provided.