Non-blocking async HTTP server
using `waitFor` blocks, so only do that if you want to block, otherwise hold onto the `Future` returned by `server.serve` template handle_server_error()= let e = getCurrentException() echo "Something went wrong." & e.msg server.close() var server_futu
Non-blocking async HTTP server
This is my code (but it obviously blocks everything). var server = newAsyncHttpServer() proc handler(req: Request) {.async,gcsafe.} = #...do some stuff await req.respond(status.HttpCode, body, headers) try: echo ":: Starting server on port " &