Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jamiei

jamiei/core.clj Secret

Created October 21, 2012 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiei/1f74b817ca5d306af9f3 to your computer and use it in GitHub Desktop.
Save jamiei/1f74b817ca5d306af9f3 to your computer and use it in GitHub Desktop.
(ns webapp.core
(:gen-class)
(:use [webapp.routes]))
(defn -main [& args]
(start-server)
)
(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)
(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