secret
Last active

  • Download Gist
core.clj
Clojure
1 2 3 4 5 6 7
(ns webapp.core
(:gen-class)
(:use [webapp.routes]))
 
(defn -main [& args]
(start-server)
)
project.clj
Clojure
1 2 3 4 5 6 7 8
(defproject webapp "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.3.0"]
[compojure "1.0.1"]
[hiccup "1.0.0"]
[ring "1.1.6"]]
:plugins [[lein-ring "0.7.1"]]
:main webapp.core)
routes.clj
Clojure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
(ns webapp.routes
(:use [compojure.core])
(:require [compojure.route :as route]
[compojure.handler :as handler]
[ring.adapter.jetty :as jetty]
[ring.middleware.params :as ring-params]))
 
 
 
(defroutes public-routes
(PUT "/something" [& _ :as {params :params}]
(println (str "Params: " params))))
 
 
(def otherapp
(-> public-routes
ring-params/wrap-params
))
 
(defn start-server []
(future (jetty/run-jetty (var otherapp) {:port 8080})))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.