Listen for Requests
import Compute
@main
struct App {
static func main() async throws {
try await onIncomingRequest(handleIncomingRequest)
}
static func handleIncomingRequest(req: IncomingRequest, res: OutgoingResponse) async throws {
print("Handling request:", req.url.pathname)
}
}Last updated
Was this helpful?