-
-
Save nivertech/5720960 to your computer and use it in GitHub Desktop.
Revisions
-
willurd revised this gist
Jun 6, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,18 @@ Each of these commands will run an ad hoc http server in your current directory. Use this power wisely. **Python 2.x** ```shell $ python -m SimpleHTTPServer 8000 ``` **Python 3.x** ```shell $ python -m http.server 8000 ``` **Ruby** Credit: http://barkingiguana.com/2010/04/11/a-one-line-web-server-in-ruby/ -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -29,13 +29,15 @@ $ perl -MCPAN -e "install HTTP::Server::Brick" # install dependency $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start' ``` **Node.js #1** ```shell $ npm install -g http-server # install dependency $ http-server -p 8000 ``` **Node.js #2** ```shell # Runs in Node.js using node-static. No directory listings. $ npm install -g node-static # install dependency -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 15 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,30 +6,38 @@ Each of these commands will run an ad hoc http server in your current directory. $ python -m SimpleHTTPServer 8000 ``` **python 3.x** ```shell $ python -m http.server 8000 ``` **ruby** Credit: http://barkingiguana.com/2010/04/11/a-one-line-web-server-in-ruby/ ```shell $ ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir.pwd).start' ``` **Perl** Credit: http://www.perlmonks.org/?node_id=865239 ```shell $ perl -MCPAN -e "install HTTP::Server::Brick" # install dependency $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start' ``` **Node.js** ```shell $ npm install -g http-server # install dependency $ http-server -p 8000 ``` ```shell # Runs in Node.js using node-static. No directory listings. $ npm install -g node-static # install dependency $ static -p 8000 ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ Each of these commands will run an ad hoc http server in your current directory. Use this power wisely. **python 2.x** ```shell $ python -m SimpleHTTPServer 8000 ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,18 +17,18 @@ $ ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir. ```shell # http://www.perlmonks.org/?node_id=865239 $ perl -MCPAN -e "install HTTP::Server::Brick" # install dependencies $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start' ``` ```shell # Runs in Node.js using http-server. $ npm install -g http-server # install dependencies $ http-server -p 8000 ``` ```shell # Runs in Node.js using node-static. No directory listings. $ npm install -g node-static # install dependencies $ static -p 8000 ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,7 @@ $ ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir. ```shell # http://www.perlmonks.org/?node_id=865239 $ perl -MCPAN -e "install HTTP::Server::Brick" $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start' ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Each of these commands will run an ad hoc http server in your current directory. Use this power wisely. ```shell # python 2.x -
willurd renamed this gist
Jun 6, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
willurd created this gist
Jun 6, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ Change `8000` to whatever port you want. ```shell # python 2.x $ python -m SimpleHTTPServer 8000 ``` ```shell # python 3.x $ python -m http.server 8000 ``` ```shell # http://barkingiguana.com/2010/04/11/a-one-line-web-server-in-ruby/ $ ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir.pwd).start' ``` ```shell # http://www.perlmonks.org/?node_id=865239 $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start' ``` ```shell # Runs in Node.js using http-server. $ npm install -g http-server $ http-server -p 8000 ``` ```shell # Runs in Node.js using node-static. No directory listings. $ npm install -g node-static $ static -p 8000 ```