Start web server from any directory using python/python3

python server

A simple python command can let you host a folder containing any site. Navigate to the directory contains the site and run following command.

If you have python 2 then use following command

python -m SimpleHTTPServer 8001

If you have python 3 then use following command

python -m http.server 8001

OR

python3 -m http.server 8001

The port option is optional and python will default run the site on 8000 port.

Subscription