Skip to content

Instantly share code, notes, and snippets.

@mrwonko
Created November 8, 2018 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrwonko/617bdd870dd8c31b6874b51acf39ecfb to your computer and use it in GitHub Desktop.
Save mrwonko/617bdd870dd8c31b6874b51acf39ecfb to your computer and use it in GitHub Desktop.
import asynchttpserver, asyncdispatch
from strformat import `&`
let name = "Willi"
proc serveIndex(req: Request) {.async.} =
await req.respond(Http200, &"hello {name}")
let server = newAsyncHttpServer()
discard server.serve(Port(8080), serveIndex, address = "127.0.0.1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment