Adding conditions to switch between live and local server