Fork me on GitHub
#yada
<
2017-07-03
>
matan21:07:30

How do I add yada to my project, such that the http service actually starts?

matan21:07:40

Seems well hidden in the docs 😕

matan21:07:43

E.g. I have this in a namespace:

(defn say-hello [ctx]
  (str "Hello " (get-in ctx [:parameters :query :p]) "!\n"))

(def hello-parameters-resource
  (resource
    {:methods
      {:get
        {:parameters {:query {:p String}}
         :produces "text/plain"
         :response say-hello}}}))

(def handler (yada/handler hello-parameters-resource))

matan21:07:56

This alone doesn't start the web service when I lein test

dominicm22:07:35

@matan you want yada/listen or yada/listener. I can't remember precisely. Check the edge repo for a demo.