Created
May 31, 2010 11:57
-
-
Save edgargoncalves/419761 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
(defn init-app-engine | |
"Initialize the app engine services." | |
([] (init-app-engine "/tmp")) | |
([directory] | |
(let [proxy-factory (ApiProxyLocalFactory.) | |
environment (proxy [LocalServerEnvironment] | |
[] | |
(getAppDir [] (java.io.File. directory))) | |
api-proxy (.create proxy-factory environment)] | |
(ApiProxy/setDelegate api-proxy)))) | |
(def *server* nil) | |
(def *application* my-app) | |
(defn start-server | |
"Start the application server." | |
[] | |
(dosync | |
(init-app-engine) | |
(def *server* (run-jetty *application* {:port 8080})))) | |
(start-server) | |
;; eval this to stop the server, then you can start it again! | |
;; (.stop *server*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment