asynchttpserver: import json in the example code

The example code won't compile unless json is imported, because
of the use of the %* operator. This can trip-up inexperienced
Nim developers.
This commit is contained in:
Luke Diamand
2017-01-10 20:33:53 +00:00
parent 6ee487b0eb
commit de7f42a741

View File

@@ -85,6 +85,7 @@ proc respond*(req: Request, code: HttpCode, content: string,
## Examples
## --------
## .. code-block::nim
## import json
## proc handler(req: Request) {.async.} =
## if req.url.path == "/hello-world":
## let msg = %* {"message": "Hello World"}