Template:egPythonHTTPServer
Syntax
{{egPythonHTTPServer}}
Usage
Code
{{egPythonHTTPServer}}
Result
- Provide a lightweight HTTP server
python -m 'http.server' 8000 --bind '127.0.0.1' --directory "${HOME}/web"
NOTE:
By default, server binds itself to all interfaces. The option -b / --bind specifies a specific address to which it should bind.
[1]
NOTE:
By default, server uses the current directory. The option -d / --directory specifies a directory to which it should serve the files.
[1]
- ↑ 1.0 1.1 Python contributors. "http.server." Python Software Foundation. https://docs.python.org/3/library/http.server.html (accessed 05.05.2023)