Created
January 13, 2014 16:59
-
-
Save jeremyckahn/8403780 to your computer and use it in GitHub Desktop.
Serves a directory and opens the root in the browser.
This file contains hidden or 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 | |
| # Open the page in 500 in milliseconds. This is done with a timer so that | |
| # http-server can be ctrl-c'ed and the browser doesn't open to a 404-ing page. | |
| echo " | |
| setTimeout(function () { | |
| require('open')('http://localhost:9000'); | |
| }, 500); | |
| " | node | |
| node node_modules/http-server/bin/http-server -p 9000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment