I've written a relatively simple HTTP server using Clojure's Aleph library. It's not very complicated:
(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 it's pretty simple, and follows the example given in Aleph's doc pretty closely. It compiles fine, but when I run it (via lein run
) it just...does nothing. The program just exits immediately; obviously it doesn't listen on port 8005 or anything like that. What am I missing here? Clearly there must be something else I need to do to start a server in Aleph.