title: How to store the root url of api in angular 4 app?
body: <p>I followed the official tutorials and made services for the Apis but absolute url of the Api is hardcoded in services.</p>
  
  <p>I want to keep the base url of Api somewhere so that i can append it to the  url path in each service before call. i also need to change the base url of Api before building (or after building).</p>
  
  <p>i tried to put it in sessionstorage, but that is a bad idea as anyone can change it and my application will start hitting other domain.</p>
  
  <p>so i kept it hard-coded and placed a post-push hook on the git to replace the url after build. but it is more like a hack than a solution.</p>
  
  <p>Can i place a file in the root directory of angular and put Api url in json format . And include it in each service so that i can exclude the file from git and each teammate and the build server can have their own file having different url.</p>
  
  <p>What should be the recommended way of doing it?</p>