From f0cb7ed4d59c31ab6e9b86a127112ee9fff6f913 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Thu, 2 Jul 2020 16:15:33 +0800 Subject: [PATCH] update dsl example[skip ci] --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index b71c38546..889323501 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,22 @@ app.route: Full examples in: [tests/test_readme/example3.nim](tests/test_readme/example3.nim). +or +```nim +import std/with + + +with app: + get "/", home + post "/", home + get "/home", home + get "/home", home + get "/redirect", doRedirect + get "/login", login + post("/login", login, middlewares = debugRequestMiddleware()) + get "/hello/{name}", helloName +``` + Run **app.nim**. Now the server is running at localhost:8080. ### More examples