25
Sharing folder and files with python http_server and ngrok to get an external url.
Python standard library comes with a in-built webserver which can be invoked for simple web client server communication. The port number can be assigned programmatically and the web server is accessed through this port. Though it is not a full featured web server which can parse many kinds of file, it can parse simple static html files and serve them by responding them with required response codes.
if you have python 2.7 run below command.
python -m SimpleHTTPServer
if you have python 3+ then try below command.
python3 -m http.server
And now the best part is to share it with other than localhost.
Install ngrok. https://ngrok.com/download
Once you have the ngrok.
run below command.
ngrok http 8000
Paste local tunnel url/ forwarding url to the browser and url can be share with anyone and they can download the files from anywhere.
Thanks for reading. :)
25