Start in DeskTop Brow with additional file

I currently have 3 scenarios for how my app will run: 1) Start in Desktop 2) www.mywebsiteproduction.com and 3) www.mywebsitetest.com. The 1st and 3rd will use the same ajax test server, while production will have a separate api URL for separate databases.

I’ll know which of the 3 scenarios by using window.location.host property. If it’s 128.0.0.1, then it’s start in browser. Otherwise, it’s one of the two host domains. If it’s anything else, well who cares - crash and burn.

Each web app site will use the api.mywebsite xxx.com for it’s api sites, eg, www.mywebsitetest.com will call api.mywebsitetest.com. I am going to use the host property and append the api. to the URL.

In the case of the Start in Desktop, the host is not the correct api URL. It should be the test domain (api.mywebsitetest.com). And I don’t want to hard code the test domain URL into the app. I’ll forget about that and post something stupid to that test domain, and … regrets will begin when someone crawls into my public app and gets the URL…

Is there a way to include an additional js file only in the Start in Desktop deployment that can be accessed by main() when main() recognizes the localhost. EG, can I add a file to the deployment folder for start in desktop, but not put it in extra files. Or can I drop a file into the project properties and then manually remove it from the extrafiles?

Does the app need to be a PWA? If so, this might be tough to do.

It looks like you could get some ideas here: