Skip to content

Instantly share code, notes, and snippets.

@christianberg
Created June 9, 2010 15:28
Show Gist options
  • Save christianberg/431643 to your computer and use it in GitHub Desktop.
Save christianberg/431643 to your computer and use it in GitHub Desktop.
(defn- set-app-engine-environment []
"Sets up the App Engine environment for the current thread."
(let [att (HashMap. {"com.google.appengine.server_url_key"
(str "http://localhost:" *port*)})
env-proxy (proxy [ApiProxy$Environment] []
(isLoggedIn [] (:logged-in? @login-info))
(getEmail [] (:email @login-info))
(getAuthDomain [] (:auth-domain @login-info))
(isAdmin [] (:admin? @login-info))
(getRequestNamespace [] "")
(getDefaultNamespace [] "")
(getAttributes [] att)
(getAppId [] "_local_"))]
(ApiProxy/setEnvironmentForCurrentThread env-proxy)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment