Python - HTTP Server
Contents
Introduction
Create a simple static file server with Python 3 http.server
module (part of its standard Library).
You can use this to test and share files locally.
Command
Run this command from the shell:
python3 -m http.server
This creates a local server accessible at http://localhost:8000
.
Specify a different port:
python3 -m http.server 4000
Conclusion
This isn’t a secure and production ready command, so use it solely for testing and sharing local files.
I test website front-ends that don’t include any code from JavaScript, PHP, Python, etc.
If you have Termux installed, you can run the server from you Android device as well.