Skip to content

Instantly share code, notes, and snippets.

@Hosuke
Created November 21, 2014 11:13
Show Gist options
  • Save Hosuke/c2e1fd9ce5baea57da42 to your computer and use it in GitHub Desktop.
Save Hosuke/c2e1fd9ce5baea57da42 to your computer and use it in GitHub Desktop.
Create a local web server

Using Python SimpleHTTPServer

The simplest way is to use SimpleHTTPServer if you already have Python installed.

Python comes already installed on most Mac OS X and Linux computers. In a terminal window, change to the directory that has your HTML files and run the following command:

python -m SimpleHTTPServer

After it starts, you can navigate to http://0.0.0.0:8000/index.html

Using MAMP / MAMP Pro

MAMP is an integrated server environment containing executables for running a web server, a database, and several programming languages. MAMP stands for Mac OS X, Apache, MySQL, and PHP/Perl/Python. Though it was originally developed for the Mac, there are versions that run on Windows.

After installing MAMP, open it and start the server.

Go to settings and set the directory to where you have saved your HTML files.

Navigate to http://localhost:8888/MAMP/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment