Skip to content

Instantly share code, notes, and snippets.

@headius
Created March 15, 2010 18:45
Show Gist options
  • Save headius/333169 to your computer and use it in GitHub Desktop.
Save headius/333169 to your computer and use it in GitHub Desktop.
import java.io.IOException;
import javax.servlet.http.* # this doesn't work yet...
import com.google.apphosting.api.ApiProxy;
import com.google.apphosting.api.ApiProxy.Environment;
class Plain < HttpServlet
def doGet(req:HttpServletRequest, resp:HttpServletResponse); throws IOException
env = ApiProxy.getCurrentEnvironment
app_id = env.getAppId
raw_ver = env.getVersionId
version = raw_ver.substring 0, raw_ver.lastIndexOf(".")
domain = env.getAuthDomain
# print out some stuff
resp.setContentType "text/plain"
resp.getWriter.println "app_id: #{app_id}\nversion: #{version}\ndomain: #{domain}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment