SakiKawasaki 5 anni fa
parent
commit
3743a77963
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  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