mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 15:31:28 +00:00
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:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user