瀏覽代碼

small fix

SakiKawasaki 5 年之前
父節點
當前提交
3743a77963
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      akane/akane.nim

+ 4 - 3
akane/akane.nim

@@ -199,14 +199,15 @@ macro pages*(server: ServerRef, body: untyped): untyped =
   ## -   ``regex``
   ## -   ``notfound`` - this page uses without URL argument.
   runnableExamples:
-    # You can also not write `equals("/")`:
+    let server = newServer(debug=true)
     server.pages:
-      "/helloworld":
-        await request.answer("Hello, world")
       equals("/home"):
         echo url
         echo urlParams
         await request.answer("Home")
+      # You can also not write `equals("/")`:
+      "/helloworld":
+        await request.answer("Hello, world")
   var
     stmtlist = newStmtList()
     notfound_declaration = false