mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
asynchttpserver: cleanup example code
This commit is contained in:
@@ -86,7 +86,7 @@ proc respond*(req: Request, code: HttpCode, content: string,
|
||||
## --------
|
||||
## .. code-block::nim
|
||||
## proc handler(req: Request) {.async.} =
|
||||
## if $req.url.path == "/hello-world":
|
||||
## if req.url.path == "/hello-world":
|
||||
## let msg = %* {"message": "Hello World"}
|
||||
## let headers = newHttpHeaders([("Content-Type","application/json")])
|
||||
## await req.respond(Http200, $msg, headers)
|
||||
|
||||
Reference in New Issue
Block a user