-
Notifications
You must be signed in to change notification settings - Fork 554
Closed
Labels
Description
When trying to run the following code (more or less copied from the readme)
import Swifter
import Foundation
func createServer() -> HttpServer {
let server = HttpServer()
server["/hello"] = { request in .ok(.text("Hey")) }
return server
}
let myServer = createServer()
try myServer.start()
The HTTP server doesn't actually start. Like, I can run swift build just fine, but actually executing the compiled binary just starts and exits normally. I would assume this isn't supposed to happen, but I can't find anything in the documentation about how one should actually start the server (the documentation also fails to mention that you need to have try before server.start()).