PadXcode-Daemon/Daemon/configure.swift

19 lines
536 B
Swift
Raw Normal View History

2026-04-12 00:42:51 -07:00
import Vapor
// `public` removed DaemonController is an internal type, not exported from a module.
func configure(_ app: Application, controller: DaemonController) throws {
app.storage[DaemonControllerKey.self] = controller
try routes(app)
}
private struct DaemonControllerKey: StorageKey {
typealias Value = DaemonController
}
extension Application {
var daemonController: DaemonController? {
get { storage[DaemonControllerKey.self] }
set { storage[DaemonControllerKey.self] = newValue }
}
}