How do I export my HTML game so I can play it straight from the file?

Godot Version

4.3 rc

Question

Hi! I came back after a while to Godot because I remembered I have some games that I could put onto a website I’m making for my school’s web development class. But I’m having some issues right now. Namely, my biggest issue is trying to get the games to run just in the browser itself.

I know that you need a server usually to run these things, which could include something like itch.io. But not only is itch.io not allowed by my school’s moderation, meaning that I probably can’t use the embed code provided by them, but I can’t even get the dumb files to launch locally after exporting them without some server inputs, which is outside the scope of what I can accomplish.

So, what would be the most straightforward way for me to get these games exported to html in a way that would allow me to play them offline with no external server or service required? And if I can’t, why the hell does this have to be?!? Why can’t it just function as a regular web game without a server to connect to?

If you review the docs on exporting for web and scroll down a bit there’s a tip which explains how to use a Python script to spin up a web server process on your local machine so you can run exported web builds without an external server.