Skip to content

Instantly share code, notes, and snippets.

@thisconnect
Forked from subtleGradient/README.md
Created January 6, 2014 09:24
Show Gist options
  • Save thisconnect/8280222 to your computer and use it in GitHub Desktop.
Save thisconnect/8280222 to your computer and use it in GitHub Desktop.

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