This repository was archived by the owner on Sep 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a functional default implementation of register in Endpoints (#8
) * Provide a functional default implementation for `register(to routes: RoutesBuilder)` for an `Endpoint` to enable Corvus Users to write composable `Endpoints` without the need to write a `register(to routes: RoutesBuilder)` function * Use an implicit return in `mapEachThrowing`
- Loading branch information
1 parent
2d2a9cd
commit 17fadda
Showing
4 changed files
with
11 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
import Vapor | ||
|
||
/// An empty default value when no `Endpoint` value is needed. | ||
public struct EmptyEndpoint: Endpoint {} | ||
public struct EmptyEndpoint: Endpoint { | ||
/// An empty default implementation of `.register()` to avoid endless loops when registering `EmptyEndpoint`s | ||
public func register(to routes: RoutesBuilder) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters