feat: Refactoring route declarations.

This commit is contained in:
2025-01-26 01:16:59 -05:00
parent 0fad024350
commit 4dc928e1f4
34 changed files with 592 additions and 606 deletions

View File

@@ -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 }
}
}