How to load files on a webserver a web app is hosted on?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kitfox

I’m writing a Godot app that will be served from a client’s web server. The client would like to have a configuration file that they can edit in a text editor and place on the server where the Godot app can load it. How can my app find this file? Is there a way for a web app to determine the URL that served it? (I tried JavaScript.eval("window.location.href"), but it’s returning the empty string). Is there a way to load files from the deploy directory directly?

:bust_in_silhouette: Reply From: kitfox

Turns out JavaScript.eval("window.location.href") was the right way to get this root URL. Not sure why it wasn’t working earlier.