diff options
author | Luke Diamand <luke@diamand.org> | 2017-01-10 20:33:53 +0000 |
---|---|---|
committer | Luke Diamand <luke@diamand.org> | 2017-01-10 20:39:29 +0000 |
commit | de7f42a7419f33ca333ac5717b800978aaec7170 (patch) | |
tree | 73b49cedfd4f65aea1e6cce4ab95136bb347d2bb /lib | |
parent | 6ee487b0eb88a21e6457b1750e0f8d829b971d17 (diff) | |
download | Nim-de7f42a7419f33ca333ac5717b800978aaec7170.tar.gz |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/asynchttpserver.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim index 68da5f7c9..a558d9d7e 100644 --- a/lib/pure/asynchttpserver.nim +++ b/lib/pure/asynchttpserver.nim @@ -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"} |