Respond to Requests
import Compute
@main
struct HelloCompute {
static func main() async throws {
try await onIncomingRequest(handleIncomingRequest)
}
static func handleIncomingRequest(req: IncomingRequest, res: OutgoingResponse) async throws {
let text = "Hello, World."
try await res.status(200).send(text)
}
}Last updated
Was this helpful?