I wrote a relatively simple HTTP server using the Clojure Aleph library. This is not very difficult:
(ns cxpond.xmlrpc.core (:gen-class) (:require [aleph.http :as http])) (defn handler [req] {:status 200 :headers {"Content-Type" "text/plain"} :body "HELLO, WORLD!"}) (defn -main [& args] (http/start-server service/handler {:port 8005}))
Obviously, this is quite simple, and pretty closely follows the example given in the Aleph document. It compiles fine, but when I run it (via lein run ), it just ... does nothing. The program ends immediately; obviously he is not listening on port 8005 or something like that. What am I missing here? Obviously, there must be something else I need to do to start the server in Aleph.
source share