Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (13 sloc) 390 Bytes
import jester, asyncdispatch, asyncnet
proc match(request: PRequest, response: PResponse): Future[bool] {.async.} =
result = true
case request.pathInfo
of "/":
await response.sendHeaders()
await response.send("Hello World!")
else:
await response.sendHeaders(Http404)
await response.send("Y'all got lost")
response.client.close()
jester.serve(match)
runForever()