title: Define server location in html jquery project
body: <p>I'm developing web system using html, jquery and node js server. Currently i'm calling ajax like below.</p>
  
  <pre><code>          $.ajax({
                  type: 'post',
                  url: serverLocation + "/api/dashboard/createUser",
                  dataType: 'json',
                  data: JSON.stringify(reqJson),
                  contentType: "application/json; charset=UTF-8",
                  success: function (response) {
                      console.log(response);
                      showAlertBox(response.message, response.status);
                  },
                  error: function (textStatus, errorThrown) {
                      console.log('Err');
                      showAlertBox("Somthing went wrong", false);
                  }
              });
  </code></pre>
  
  <p>you can see I used <strong><em>serverLocation</em></strong> variable in url attribute. Honestly I define "serverLocation" in above of the js file as a constant and I did it in every js files. (I know it is not a good programming practice).</p>
  
  <pre><code>const serverLocation = "http://127.0.0.1:9173"; 
  </code></pre>
  
  <p>So when we going to deploy in production server, how to define this serverlocation in one place and use it in all js files?</p>
  
  <p>The other question is, expose this kind of server information in client side will hit to security. In that case how to avoid it?</p>