CloudCode GetServer

From view JS, we can get the current server using journey.server. I’d like to do something similar from a CloudCode task to see on which server the code is running.

Use case: we’re using the same SSO app in both Stage and Prod and we want to authenticate different users / groups based on if they’re trying to access Stage or Prod.

You can inspect this.env in your CloudCode task to get the server environment [testing, staging, production] and use that to differentiate between your various environments.