-
-
Save StevenBlack/5726345 to your computer and use it in GitHub Desktop.
Revisions
-
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 @@ -22,7 +22,7 @@ Depends on [Twisted](http://twistedmatrix.com/trac/wiki/Downloads). $ twistd -n web -p 8000 --path . ``` Or: ```shell $ python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; reactor.listenTCP(8000, Site(File("."))); reactor.run()' -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 6 additions 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 @@ -18,6 +18,12 @@ $ python -m http.server 8000 Depends on [Twisted](http://twistedmatrix.com/trac/wiki/Downloads). ```shell $ twistd -n web -p 8000 --path . ``` The old way: ```shell $ python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; reactor.listenTCP(8000, Site(File("."))); reactor.run()' ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 2 additions 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 @@ -79,6 +79,8 @@ $ perl -MMojolicious::Lite -MCwd -e 'app->static->paths->[0]=getcwd; app->start' **Node.js #1** Note: This server does funky things with relative paths. For example, if you have a file `/tests/index.html`, it will load `index.html` if you go to `/test`, but will treat relative paths as if they were coming from `/`. ```shell $ npm install -g http-server # install dependency $ http-server -p 8000 -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 9 additions 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 @@ -41,6 +41,15 @@ $ gem install adsf # install dependency $ adsf -p 8000 ``` **Sinatra (Ruby)** No directory listings. ```shell $ gem install sinatra # install dependencies $ ruby -rsinatra -e'set :public_folder, "."; set :port, 8000' ``` **Perl** Credit: [Anonymous Monk](http://www.perlmonks.org/?node_id=865239) -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 2 additions and 2 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 @@ -91,7 +91,7 @@ Credit: [/u/prawnsalad](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_a No directory listings. ```shell $ php -S 127.0.0.1:8000 ``` **Erlang** @@ -101,7 +101,7 @@ Credit: [@nivertech](https://gist.github.com/willurd/5720255/#comment-841166) (w No directory listings. ```shell $ erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).' ``` **IIS Express** -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 2 additions 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 @@ -61,6 +61,8 @@ $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");' -p **Mojolicious (Perl)** No directory listings. ```shell $ cpan Mojolicious::Lite # install dependency $ perl -MMojolicious::Lite -MCwd -e 'app->static->paths->[0]=getcwd; app->start' daemon -l http://*:8000 -
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 @@ -56,7 +56,7 @@ Credit: [miyagawa](http://advent.plackperl.org/2009/12/day-5-run-a-static-file-w ```shell $ cpan Plack # install dependency $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");' -p 8000 ``` **Mojolicious (Perl)** -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 1 addition and 2 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 @@ -55,8 +55,7 @@ $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mo Credit: [miyagawa](http://advent.plackperl.org/2009/12/day-5-run-a-static-file-web-server-with-plack.html) ```shell $ cpan Plack # install dependency $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root => ".");' -p 8000 ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 10 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 @@ -36,7 +36,7 @@ Credit: [@twome](https://gist.github.com/willurd/5720255/#comment-841393) No directory listings. ```shell $ gem install adsf # install dependency $ adsf -p 8000 ``` @@ -46,20 +46,27 @@ $ adsf -p 8000 Credit: [Anonymous Monk](http://www.perlmonks.org/?node_id=865239) ```shell $ cpan HTTP::Server::Brick # install dependency $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start' ``` **Plack (Perl)** Credit: [miyagawa](http://advent.plackperl.org/2009/12/day-5-run-a-static-file-web-server-with-plack.html) ```shell $ curl -L http://cpanmin.us | perl - --sudo App::cpanminus # install cpanminus $ cpanm Plack # install dependency $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root => ".");' -p 8000 ``` **Mojolicious (Perl)** ```shell $ cpan Mojolicious::Lite # install dependency $ perl -MMojolicious::Lite -MCwd -e 'app->static->paths->[0]=getcwd; app->start' daemon -l http://*:8000 ``` **Node.js #1** ```shell -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 5 additions and 4 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 @@ -110,8 +110,9 @@ C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:80 # Meta If you have any suggestions, drop them in the comments below or on the reddit discussion. To get on this list, a solution must: 1. serve static files using your current directory (or a specified directory) as the server root, 2. be able to be run with a single, one line command (dependencies are fine if they're a one-time thing), 3. serve basic file types (html, css, js, images) with proper mime types, 4. require no configuration (from files or otherwise) beyond the command itself (no framework-specific servers, etc) -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 3 additions and 2 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 @@ -112,5 +112,6 @@ C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:80 If you have any suggestions, drop them in the comments below or on the reddit discussion. To get on this list, a solution has to: 1. Serve static files using your current directory (or a specified directory) as the server root. 2. Be able to be run with just one line (dependencies are fine if they're a one-time thing). 3. Serve basic file types (html, css, js, images) with proper mime types. -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 7 additions 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 @@ -107,3 +107,10 @@ Depends on [IIS Express](http://www.iis.net/learn/extensions/introduction-to-iis ```shell C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:8000 ``` # Meta If you have any suggestions, drop them in the comments below or on the reddit discussion. To get on this list, a solution has to: 1. Serve static files (with proper mime types) using your current directory (or a specified directory) as the server root. 2. Be able to be run with just one line (dependencies are fine if they are a one-time thing). -
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 @@ -55,7 +55,7 @@ $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mo Credit: [miyagawa](http://advent.plackperl.org/2009/12/day-5-run-a-static-file-web-server-with-plack.html) ``` $ curl -L http://cpanmin.us | perl - --sudo App::cpanminus # install cpanminus $ cpanm Plack # install dependency $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root => ".");' -p 8000 ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 14 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 @@ -14,7 +14,7 @@ $ python -m SimpleHTTPServer 8000 $ python -m http.server 8000 ``` **Twisted (Python)** Depends on [Twisted](http://twistedmatrix.com/trac/wiki/Downloads). @@ -30,6 +30,17 @@ Credit: [Barking Iguana](http://barkingiguana.com/2010/04/11/a-one-line-web-serv $ ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir.pwd).start' ``` **adsf (Ruby)** Credit: [@twome](https://gist.github.com/willurd/5720255/#comment-841393) No directory listings. ``` $ gem install adsf # install dependency $ adsf -p 8000 ``` **Perl** Credit: [Anonymous Monk](http://www.perlmonks.org/?node_id=865239) @@ -44,8 +55,8 @@ $ perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mo Credit: [miyagawa](http://advent.plackperl.org/2009/12/day-5-run-a-static-file-web-server-with-plack.html) ``` $ curl -L http://cpanmin.us | perl - --sudo App::cpanminus # install cpanminus if you don't have it $ cpanm Plack # install dependency $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root => ".");' -p 8000 ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 10 additions 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 @@ -39,6 +39,16 @@ $ 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' ``` **Plack (Perl)** Credit: [miyagawa](http://advent.plackperl.org/2009/12/day-5-run-a-static-file-web-server-with-plack.html) ``` $ curl -L http://cpanmin.us | perl - --sudo App::cpanminus # install cpanminus $ cpanm Plack # install plack $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root => ".");' -p 8000 ``` **Node.js #1** ```shell -
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 @@ -18,7 +18,7 @@ $ python -m http.server 8000 Depends on [Twisted](http://twistedmatrix.com/trac/wiki/Downloads). ```shell $ python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; reactor.listenTCP(8000, Site(File("."))); reactor.run()' ``` -
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,6 +1,6 @@ [Discussion on reddit](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/). Each of these commands will run an ad hoc http static file server in your current (or specified) directory. Use this power wisely. **Python 2.x** -
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,6 +1,6 @@ [Discussion on reddit](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/). Each of these commands will run an ad hoc http server in your current (or specified) directory. Use this power wisely. **Python 2.x** -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 11 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,3 +1,5 @@ [Discussion on reddit](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/). Each of these commands will run an ad hoc http server in your current directory. Use this power wisely. **Python 2.x** @@ -12,6 +14,14 @@ $ python -m SimpleHTTPServer 8000 $ python -m http.server 8000 ``` **Python Twisted** Depends on [Twisted](http://twistedmatrix.com/trac/wiki/Downloads). ``shell $ python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; reactor.listenTCP(8000, Site(File("."))); reactor.run()' ``` **Ruby** Credit: [Barking Iguana](http://barkingiguana.com/2010/04/11/a-one-line-web-server-in-ruby/) @@ -71,7 +81,7 @@ Credit: [/u/fjantomen](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad No directory listings. `/path` *must* be an absolute path. Depends on [IIS Express](http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-express-overview). ```shell C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:8000 -
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 @@ -71,7 +71,7 @@ Credit: [/u/fjantomen](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad No directory listings. `/path` *must* be an absolute path. Depends on IIS Express which "comes with WebMatrix, Visual Studio or can be installed separately". ```shell C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:8000 -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 12 additions 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 @@ -64,3 +64,15 @@ No directory listings. ```shell erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).' ``` **IIS Express** Credit: [/u/fjantomen](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/cada8no) No directory listings. `/path` *must* be an absolute path. Depends on IIS Express which "comes with WebMatrix, Visual Studio or can be installed separately" (credit [/u/fjantomen](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/cada8no)) ```shell C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:8000 ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 6 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 @@ -38,8 +38,9 @@ $ http-server -p 8000 **Node.js #2** No directory listings. ```shell $ npm install -g node-static # install dependency $ static -p 8000 ``` @@ -48,6 +49,8 @@ $ static -p 8000 Credit: [/u/prawnsalad](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/cad9ew3), [@MattLicense](https://gist.github.com/willurd/5720255#comment-841131) No directory listings. ```shell php -S 127.0.0.1:8000 ``` @@ -56,6 +59,8 @@ php -S 127.0.0.1:8000 Credit: [@nivertech](https://gist.github.com/willurd/5720255/#comment-841166) (with the addition of some basic mime types) No directory listings. ```shell erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).' ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 1 addition 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 @@ -46,9 +46,7 @@ $ static -p 8000 **PHP >= 5.4** Credit: [/u/prawnsalad](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/cad9ew3), [@MattLicense](https://gist.github.com/willurd/5720255#comment-841131) ```shell php -S 127.0.0.1:8000 -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 2 additions and 2 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 @@ -14,15 +14,15 @@ $ python -m http.server 8000 **Ruby** Credit: [Barking Iguana](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: [Anonymous Monk](http://www.perlmonks.org/?node_id=865239) ```shell $ perl -MCPAN -e "install HTTP::Server::Brick" # install dependency -
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 @@ -47,16 +47,16 @@ $ static -p 8000 **PHP >= 5.4** Credit: * [/u/prawnsalad](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/cad9ew3) * [@MattLicense](https://gist.github.com/willurd/5720255#comment-841131) ```shell php -S 127.0.0.1:8000 ``` **Erlang** Credit: [@nivertech](https://gist.github.com/willurd/5720255/#comment-841166) (with the addition of some basic mime types) ```shell erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).' -
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 @@ -56,7 +56,7 @@ php -S 127.0.0.1:8000 **Erlang** Credit: @nivertech https://gist.github.com/willurd/5720255/#comment-841166 (with the addition of some basic mime types) ```shell erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).' -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 8 additions 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 @@ -53,3 +53,11 @@ Credit: ```shell php -S 127.0.0.1:8000 ``` **Erlang** Credit: https://gist.github.com/willurd/5720255/#comment-841166 (with the addition of some basic mime types) ```shell erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).' ``` -
willurd revised this gist
Jun 6, 2013 . 1 changed file with 10 additions 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 @@ -43,3 +43,13 @@ $ http-server -p 8000 $ npm install -g node-static # install dependency $ static -p 8000 ``` **PHP >= 5.4** Credit: * http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/cad9ew3 * https://gist.github.com/willurd/5720255#comment-841131 ```shell php -S 127.0.0.1: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 @@ -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
NewerOlder