I have a JS file that gets served by a Node.Js server to a web browser.
When running in Dev I want the client-side JS to send data to the localhost so can I log the payload to my local node.js server.
But when we deploy to production I of course want the client-side JS file to send data from the browser to my Production URL.
Right now I've been manually modifying the URL in the JS file that gets served, toggling between localhost and the public URL before I do my Gulp build but I know that is not the right way, and prone to the "whoops I forgot" issue.
What is the correct approach? Or best practice? Is there some gulp package I should be using?