-
-
Save woodie/333173 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import java.io.IOException | |
import javax.servlet.http.HttpServlet | |
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 | |
raw_ver = env.getVersionId | |
version = raw_ver.substring 0, raw_ver.lastIndexOf(".") | |
# Spit out a JSON | |
resp.setContentType "text/plain" | |
resp.getWriter.println "\"{app_id\":\"#{env.getAppId}\",\n" + | |
"\"version\":\"#{version}\",\n" + | |
" \"domain\":\"#{env.getAuthDomain}\"}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment