Skip to content

Instantly share code, notes, and snippets.

@ibdknox
Created November 6, 2010 09:07
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 ibdknox/665304 to your computer and use it in GitHub Desktop.
Save ibdknox/665304 to your computer and use it in GitHub Desktop.
Trying to use aleph with compojure routes, but the post params never make it through on the aleph server, while they are working fine on the jetty one.
(ns wl.simple
(:use compojure.core, aleph.http, hiccup.core, hiccup.form-helpers, ring.adapter.jetty)
(:gen-class))
(defn show-params [values]
(println (str values))
(html [:p (str values)]))
(defroutes myroutes
(GET "/" [] (html (form-to [:post "/"]
(text-field "var")
(submit-button "go"))))
(POST "/" {params :params} (show-params params)))
(start-http-server (wrap-ring-handler myroutes) {:port 8080})
(run-jetty (var myroutes) {:port 10000})
(defproject testproj "1.0.0-SNAPSHOT"
:description "test project"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[aleph "0.1.2-SNAPSHOT"]
[hiccup "0.2.7"]
[ring/ring-jetty-adapter "0.2.3"]
[compojure "0.5.2"]]
:main wl.simple)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment