I have written an apex class which makes a callout to an external API, and the endpoints need to be different for the sandbox and production.
I need functionality like environmental variables so the code can remain unchanged and the variables can be different in production.
I came across custom settings which looks fine for this purpose but after I create the custom setting, create my desired fields, when I put in organization default values it hangs and times out after a few minutes saying "Time limit exceeded: Your request exceeded the time limit for processing.".
I've tried waiting an hour or so and seeing if it resolves itself but I always get this result, and no values are inserted.
Why is this happening?
and are there any alternatives to custom settings for this purpose?