Get environment variables in Advanced Mock script?

Can I get environment variables, like the current baseUrl, from an advanced Mock script? I’d like to link to other endpoints from the body of my response and I’m unsure how to do this.

Mock scripts do not support reading content from the environment because the mock runs independently of the environment

Can you provide a detailed description of your specific usage scenario

The API I’m implementing (open standard so cannot change this) is REST-ish in the sense that one of endpoints returns you the URLs that point to the other endpoints. So I want to return the endpoints to the Local and Cloud Mock depending on the environment I’m running in.

It also always contains a recent date/time which I’m able to do in the scripts, but am unable to do in the Mock Expectations, see related question: Discord

I also tried getting the baseUrl from the request object by the way, but that one’s empty

The goal of the Mock feature is to return different response according to different request PARAMS or BODIES. More complex situations are not supported.

Okay, then it won’t be useful for this I guess. Thanks. Hope the script route will work, see Discord