JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

joy/routes

joy


    macro
    /usr/local/lib/janet/joy/router.janet on line 296, column 1

    (routes & args)


1 exampleSign in to add an example
Loading...
(import joy)

# given a handler
(defn handle-func [request]
  (joy/text/plain (string "Hi " ((request :params) :name))))

# joy/routes will make handlers
(def r (joy/routes [:get "/hi/:name" :handle-func]))
# which you can pass to joy/app
(joy/server (joy/app {:routes r}) 9002)
# visit at localhost:9002/hi/bob
veqqqPlayground