Trouble hosting Godot project on Flask Server

Godot Version

Godot-Stable 4.5.1

Question

So, I’m not sure if this is the right place to ask this question, since it’s partly a Godot question, and partly a Python question:

I’m trying to host a Godot 4 web project using a Python Flask HTTP server; however, I can’t figure out how to properly host the project. I’ve tried simply putting all of the files together in one folder, and then pointing to the index.html, however it then fails to find the other assets. Any suggestions?

I’m getting error messages like this one:

(index):112   GET http://localhost:5000/index.js net::ERR_ABORTED 404 (NOT FOUND)

I figured it out! For anyone trying to do this in the future, you’ll need to use the “send_from_directory” module to point to a specific folder whenever the client tries to access the files (for instance “http:/localhost:5000/index.js”) Just remember to put all of your files except for your “index.html” in there.