Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns live-update.handler
- (:require [compojure.core :refer :all]
- [compojure.route :as route]
- [ring.middleware.defaults :refer [wrap-defaults site-defaults]]
- [clj-http.client :as client]))
- (comment
- (:body
- (client/post "http://localhost:3000"
- {:form-params
- {:some-edn
- (pr-str
- '(defn hello
- []
- "hi there"))}}))
- (:body (client/get "http://localhost:3000")))
- (defn hello
- []
- "hey")
- (defroutes app-routes
- (GET "/" [] (#'hello))
- (POST "/" [some-edn] (pr-str (eval (clojure.core/read-string some-edn))))
- (route/not-found "Not Found"))
- (def app
- (wrap-defaults app-routes (assoc-in site-defaults [:security :anti-forgery] false)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement