Skip to content

Instantly share code, notes, and snippets.

@timotheecour
Created August 14, 2021 02:28
Show Gist options
  • Save timotheecour/612afab3314b30e3c15ad9ba7e97a628 to your computer and use it in GitHub Desktop.
Save timotheecour/612afab3314b30e3c15ad9ba7e97a628 to your computer and use it in GitHub Desktop.
when defined case4:
# still bug
import asynchttpserver, asyncdispatch
var server = newAsyncHttpServer()
proc cb(req: Request) {.async.} =
await req.respond(Http200, "Hello World case4")
let port = 5001
echo "test this with: curl localhost:" & $port.uint16 & "/"
waitFor server.serve(Port(port), cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment