How can an app know that it works in Google AppEngine?

I am trying to find a way to make the Appengine Java application detect whether it is running on Appengine servers or inside the development environment mini-server. I would like to do this programmatically, and not through any properties file or other configuration option. Does anyone have any ideas?

+4
source share
2 answers

Version 1.3.0 of the SDK added some system properties that you can check to get this information:

com.google.appengine.runtime.{version,environment}

+3
source

The following system variables are set inside App Engine: http://code.google.com/intl/de-DE/appengine/docs/java/runtime.html#The_Environment
With System.getProperty should check to see if the Engine application is running.

0
source

Source: https://habr.com/ru/post/1300186/


All Articles