As a developer I run into a lot of situations where I need to fire up a quick web server to perform some task. Python ships with osx and makes this task quite simple.
In terminal enter:
If you have Python installed and all went well the terminal will output this:
Now you can access the directory in your browser
http://localhost:8080. If you are loading a static website the root url should load the
index.html, otherwise it’ll be a directory listing of the files in that folder.
Depending on the network, the web server should be viewable on other devices on the same network. To reach the server you will need to find the IP address of the host machine along with the port number we started the server on. Enter this into a browser on the target device. ie.
http://192.168.1.1:8080 and browse away.
If we need to run multiple web servers or switch the port, just change the port param in the command
8080 to the desired port