Run a HTTP server in any folder (Mac)

Use this one-liner to serve any directory on Mac on the local network. Navigate to the directory in the terminal first.

python -m SimpleHTTPServer 8000

You can also leave the port out so that it uses the default port 80.

Now, in a browser, type in the below to access the directory files.

http://localhost:8000

Use CTRL+C to end.

If other devices on the local network want to access, replace localhost with your local ip e.g. below:

http://192.168.0.14:8000

Screen Shot 2016-07-16 at 23.15.23

Advertisements