This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-02
Channels
- # 100-days-of-code (1)
- # announcements (2)
- # beginners (122)
- # boot (5)
- # calva (5)
- # cider (54)
- # cljdoc (1)
- # clojure (132)
- # clojure-brasil (1)
- # clojure-italy (4)
- # clojure-nl (6)
- # clojure-uk (105)
- # clojurescript (43)
- # core-async (17)
- # cursive (14)
- # datomic (60)
- # emacs (35)
- # figwheel-main (44)
- # fulcro (70)
- # graphql (1)
- # jobs (19)
- # jobs-discuss (5)
- # leiningen (5)
- # luminus (2)
- # off-topic (40)
- # onyx (2)
- # overtone (5)
- # re-frame (36)
- # reagent (29)
- # ring-swagger (20)
- # rum (13)
- # shadow-cljs (19)
- # testing (5)
- # tools-deps (25)
- # vim (5)
Looking to make a simple rest like api and I found
(sweet/api
(sweet/GET "/ping" []
(response/ok {:ping "pong"})))
(def app
(sweet/api
(sweet/GET "/hello" []
:query-params [name :- String]
(response/ok {:message (str "Hello, " name)}))))
@ikitommi don't I have to "register" it somewhere? the basic handler examples make a function called handler
then do something like (server handler {:port 3000})
or put it in the project.cjl as :ring {:handler handler}
@mping I am finding lots of handler examples but nothing about the ways to register handlers.
luminus has some nice guides on how to run the app: http://www.luminusweb.net/docs#running_the_application