Created
November 6, 2010 09:07
-
-
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.
This file contains hidden or 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 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}) |
This file contains hidden or 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 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