Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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)
(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
You can’t perform that action at this time.