feat: Refactoring route declarations.
This commit is contained in:
@@ -3,16 +3,16 @@ import Foundation
|
||||
@preconcurrency import URLRouting
|
||||
|
||||
public enum SiteRoute: Sendable {
|
||||
case api(ApiRoute)
|
||||
case api(SiteRoute.Api)
|
||||
case health
|
||||
case view(ViewRoute)
|
||||
case view(SiteRoute.View)
|
||||
|
||||
public static let router = OneOf {
|
||||
Route(.case(Self.view)) { ViewRoute.router }
|
||||
Route(.case(Self.view)) { SiteRoute.View.router }
|
||||
Route(.case(Self.health)) {
|
||||
Path { "health" }
|
||||
Method.get
|
||||
}
|
||||
Route(.case(Self.api)) { ApiRoute.router }
|
||||
Route(.case(Self.api)) { SiteRoute.Api.router }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user