-
-
Save KirinDave/be11b181842fce78ade5 to your computer and use it in GitHub Desktop.
This file contains 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
Click <mouse-2> on a completion to select it. | |
In this buffer, type RET to select the completion near point. | |
Possible completions are: | |
clothesline.interop.Factory/clone__var clothesline.interop.Factory/equals__var | |
clothesline.interop.Factory/hashCode__var | |
clothesline.interop.Factory/main clothesline.interop.Factory/main__var | |
clothesline.interop.Factory/makeServer__var | |
clothesline.interop.Factory/toString__var |
This file contains 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 clothesline.core | |
(:require [clothesline.protocol [graph :as graph]] | |
[ring.adapter [jetty :as ring]]) | |
(:use [clothesline.request-handler :only [compile-route-map handler *routes*]] | |
clothesline.util) | |
(:import org.mortbay.jetty.Server) | |
(:gen-class :name clothesline.interop.Factory | |
:methods [^:static [makeServer | |
[java.util.Map java.util.Map] ; -> | |
org.mortbay.jetty.Server]])) | |
(def ^{:doc "Set false if you hate performance"} *auto-compile-routes* true) | |
(defn produce-server | |
([routes server-opts] | |
(binding [*routes* (if *auto-compile-routes* (compile-route-map routes) routes)] | |
(ring/run-jetty (bound-fn [req] (handler req)) server-opts))) | |
([routes] (produce-server routes {:port 80 :join? false}))) | |
;; Expose to the outside world. | |
(defn ^{:static true} -makeServer [routeTable server-opts] | |
(produce-server routeTable (map-keys keyword server-opts))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment