Skip to content

Instantly share code, notes, and snippets.

@edgargoncalves
Created May 31, 2010 11:57
Show Gist options
  • Save edgargoncalves/419761 to your computer and use it in GitHub Desktop.
Save edgargoncalves/419761 to your computer and use it in GitHub Desktop.
(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