I need to check if the server is running on app engine.
Something like this:
if (canRunAppEngine) {
runAppEngine(app.handleRequest);
} else {
app.start();
}
You can specify environment variables and then check in your Dart code whether it is set
https://cloud.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Defining_environment_variables
app.yaml
env_variables:
IS_APPENGINE: 'true'
in Dart
if(Platform.environment['IS_APPENGINE'] == 'true') {
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With