Python’s SimpleHTTPServer is very lightweight and very useful. If you want to share files from your localhost or if you want a quick web server without messing with setting up apache or something similar SimpleHTTPServer is here for you. All you need is installing Python. On OS X Python is already installed by default so SimpleHTTPServer is at your service…
Open up a terminal window (or command line), browse to the directory where you want to serve your files, and start SimpleHTTPServer. If the directory has a file named index.html, that file will be served as the default/home file. If there is no index.html, then the files in the directory will be listed.
You can use the following command to start SimpleHTTPServer:
python -m SimpleHTTPServer
If you want to specify a port you can use this command:
python -m SimpleHTTPServer 8080
Hope this helps.