Serving One Page Over HTTP
Retrospective web development exercise for the 2012 archive.
Open a page directly from disk and note that its address starts with file:. Then serve the same directory over HTTP on your own machine. On a current Python installation, python3 -m http.server --bind 127.0.0.1 8000 starts a simple lab server from the current directory.
Request a file that exists and one that doesn’t. Compare the status codes in the browser’s Network panel. The missing file should return 404. That’s a useful way to learn what the server sees when a link looks right in the editor and still fails in the browser. Stop the server with Ctrl+C when you’re done.