Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
Created July 19, 2012 13:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save subtleGradient/3143733 to your computer and use it in GitHub Desktop.
Save subtleGradient/3143733 to your computer and use it in GitHub Desktop.
How to create a double-click-to-start web server

How to create a double-click-to-start web server

  1. Download the "Start HTTP Server Here.command" file
    • In Safari you can do that by ⌥ (option) clicking the "raw" link next to that script.
  2. Add the executable flag
    so that it will run when you double-click it
    • type chmod +x "$HOME/Downloads/Start HTTP Server Here.command"
  3. Move the command file into the root folder of your website
  4. Double-click it to start your webserver.
    Your browser will load it up automatically
#!/bin/bash
cd "$(dirname "$0")"
sleep .5 && open http://:8001&
python -m SimpleHTTPServer 8001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment