- Download the "Start HTTP Server Here.command" file
- In Safari you can do that by ⌥ (option) clicking the "raw" link next to that script.
- Add the executable flag
so that it will run when you double-click it- type
chmod +x "$HOME/Downloads/Start HTTP Server Here.command"
- type
- Move the
command
file into the root folder of your website - Double-click it to start your webserver.
Your browser will load it up automatically
-
-
Save eerne/3145356 to your computer and use it in GitHub Desktop.
How to create a double-click-to-start web server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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