public
Created

Boot up a quick development server

  • Download Gist
server.md
Markdown

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.

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}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.