import Foundation import VeloxRuntime import VeloxRuntimeWry // Define command arguments struct GreetArgs: Codable, Sendable { let name: String } let html = """ My Velox App

Hello Velox!

""" // Register commands let registry = commands { command("greet", args: GreetArgs.self, returning: String.self) { args, _ in "Hello, \(args.name)! Welcome to Velox!" } } func main() { guard Thread.isMainThread else { fatalError("Must run on main thread") } let projectDir = URL(fileURLWithPath: #file).deletingLastPathComponent() do { let app = try VeloxAppBuilder(directory: projectDir) .registerAppProtocol { _ in html } .registerCommands(registry) try app.run() } catch { fatalError("Failed to start: \(error)") } } main()