5 comments

  • Eric HuEric Hu, almost 8 years ago (edited almost 8 years ago )

    To take it further you can write a shortcut in your bash profile to just type something like "pstart" to fire it up.

    I actually started using this one called http-server that I feel is way faster than the python one for static sites. You just "npm install http-server". https://www.npmjs.org/package/http-server

    4 points
  • Sumul Shah, almost 8 years ago (edited almost 8 years ago )
    $ python -m SimpleHTTPServer 8000
    $ ruby -run -e httpd . -p 8000
    $ php -S localhost:8000 -t .
    3 points
  • Varun VachharVarun Vachhar, almost 8 years ago (edited almost 8 years ago )

    Take it one step further and add this to your ~/.bash_profile:

    server() { open "http://localhost:${1}" && python -m SimpleHTTPServer $1 }

    allows you to start the server and automatically open the browser by just calling server <port-number> eg: server 3000 or just server

    1 point
  • Tyler DeitzTyler Deitz, almost 8 years ago (edited almost 8 years ago )

    for python3 the command is now:

    python -m http.server
    1 point