Tuesday 14 March 2017

Can request (or other similar) use multiple addresses for getting data?

I want to have a list or array of addresses for the the system to try.

For example: dev1.someplacecom, dev2.someplace.com, productions.someplace.com.

So that during dev work it will be getting data from production, but if I spin up a dev API server it just comes "online" to the code I'm working on.

I know I can do this with ENV variables, but we may be working with some different servers and it would be great to just start and stop them and have the code know which. Currently we are doing something similar by using a HAPROXY setup, but if the code itself did it would be better.

Just a thought. Is it possible?

Thanks.



via Tim Meade

No comments:

Post a Comment