-
-
Save jamiei/1f74b817ca5d306af9f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns webapp.core | |
(:gen-class) | |
(:use [webapp.routes])) | |
(defn -main [& args] | |
(start-server) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment