Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created February 19, 2013 20:45
Show Gist options
  • Save tmcw/4989751 to your computer and use it in GitHub Desktop.
Save tmcw/4989751 to your computer and use it in GitHub Desktop.
Boot up a quick development server

Booting Up A Development Server

Open a console. Terminal.app on Macs, your shell or whatever on PCs.

Python is easiest:

python -m SimpleHTTPServer 8000

Then go to http://localhost:8000/ in a web browser.

A nodejs junkie?

npm install -g serve
serve

Then go to http://localhost:3000/ in a web browser.

@simon04
Copy link

simon04 commented May 2, 2013

php -S localhost:8000 works as well (see http://php.net/manual/en/features.commandline.webserver.php)

I set the following functions in my .bashrc for quick access:

httpd_py () {
  python2 -m SimpleHTTPServer ${1:-8000}
}

httpd_php () {
  php -S localhost:${1:-8000}
}

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