First of all, I will talk a little about the purpose of this question. We have several linux boxes on the same network on which different services are installed, some times these boxes are decommissioned and new boxes take its place. The services also need to be moved along with thoxe boxes. Now my internal web portal which is built in angular.js has to be be redeployed with the new set of hardcoded urls to access the services in the new boxes.I am trying to get around this problem by creating a page that we could use to change the backend database and trigger the website to reload the url mappings from the DB. So in the event there is a box move the service urls can be picked up dynamically on changing the config. All the configuration is stored in a Database.I havent figured out the triggering part yet. Is this the correct way of creating the setup, or am I doing it all wrong. With my limited knowledge in web dev this is all I could come up with.Any pointers or reference docs would be very useful.Thank You!
Making backend service urls configurable
web development;web applications;web;websites;angularjs
Short answer:Do the name to box resolution at the network tier, either setup a DNS server as the 'database' that holds the resolution table, or do it in the router. An easier approach might be to set up the routes in your web portal machine's hosts file. Depending on how you make the calls that might not need a redeploy. Longer answer:I you want to go for a bigger change then an approach used in the new 'cloud' way would be to have a state store keeping track of your network topology. So if each application was in a docker container and your network mapping (key = hostname to value = ip address ) was in say ZooKeeper then the 'triggers' can be ZooKeeper watchers that are capable of spinning up new docker conatiners when a new child node is created in your ZooKeeper registry. PS.There are other ways of storing the state than ZooKeeper. If you don't want to use docker containers then you could use Virtual Machines. 