feat: Refactoring route declarations.

This commit is contained in:
2025-01-19 10:52:15 -05:00
parent d27a19863a
commit 1c8748211c
20 changed files with 954 additions and 644 deletions

View File

@@ -0,0 +1,18 @@
import CasePathsCore
import Foundation
@preconcurrency import URLRouting
public enum SiteRoute: Sendable {
case api(ApiRoute)
case health
case view(ViewRoute)
public static let router = OneOf {
Route(.case(Self.view)) { ViewRoute.router }
Route(.case(Self.health)) {
Path { "health" }
Method.get
}
Route(.case(Self.api)) { ApiRoute.router }
}
}