PadXcode-Daemon/Daemon/configure.swift
2026-04-12 00:42:51 -07:00

18 lines
536 B
Swift

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