Skip to content

Instantly share code, notes, and snippets.

@saidler
Forked from willurd/web-servers.md
Created June 7, 2013 00:22
Show Gist options
  • Save saidler/5726195 to your computer and use it in GitHub Desktop.
Save saidler/5726195 to your computer and use it in GitHub Desktop.

Revisions

  1. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original 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 .
    ```

    The old way:
    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()'
  2. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions web-servers.md
    Original 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()'
    ```
  3. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions web-servers.md
    Original 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
  4. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions web-servers.md
    Original 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)
  5. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions web-servers.md
    Original 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
    $ 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"}]}]).'
    $ 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**
  6. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions web-servers.md
    Original 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
  7. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original 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
    $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");' -p 8000
    ```

    **Mojolicious (Perl)**
  8. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions web-servers.md
    Original 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
    $ curl -L http://cpanmin.us | perl - --sudo App::cpanminus # install cpanminus
    $ cpanm Plack # install dependency
    $ cpan Plack # install dependency
    $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root => ".");' -p 8000
    ```

  9. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions web-servers.md
    Original 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
    $ perl -MCPAN -e "install HTTP::Server::Brick" # install dependency
    $ 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
  10. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions web-servers.md
    Original 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 has to:
    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 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.
    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)
  11. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions web-servers.md
    Original 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 (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).
    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.
  12. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions web-servers.md
    Original 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).
  13. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original 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 if you don't have it
    $ 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
    ```
  14. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 14 additions and 3 deletions.
    17 changes: 14 additions & 3 deletions web-servers.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ $ python -m SimpleHTTPServer 8000
    $ python -m http.server 8000
    ```

    **Python Twisted**
    **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
    $ cpanm Plack # install plack
    $ 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
    ```

  15. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions web-servers.md
    Original 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
  16. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original 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
    ```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()'
    ```

  17. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original 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.
    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**

  18. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original 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 directory. Use this power wisely.
    Each of these commands will run an ad hoc http server in your current (or specified) directory. Use this power wisely.

    **Python 2.x**

  19. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion web-servers.md
    Original 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 which "comes with WebMatrix, Visual Studio or can be installed separately".
    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
  20. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original 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" (credit [/u/fjantomen](http://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners/cada8no))
    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
  21. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions web-servers.md
    Original 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
    ```
  22. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion web-servers.md
    Original file line number Diff line number Diff line change
    @@ -38,8 +38,9 @@ $ http-server -p 8000

    **Node.js #2**

    No directory listings.

    ```shell
    # Runs in Node.js using node-static. No directory listings.
    $ 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"}]}]).'
    ```
  23. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions web-servers.md
    Original 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)
    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
  24. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions web-servers.md
    Original file line number Diff line number Diff line change
    @@ -14,15 +14,15 @@ $ python -m http.server 8000

    **Ruby**

    Credit: http://barkingiguana.com/2010/04/11/a-one-line-web-server-in-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: http://www.perlmonks.org/?node_id=865239
    Credit: [Anonymous Monk](http://www.perlmonks.org/?node_id=865239)

    ```shell
    $ perl -MCPAN -e "install HTTP::Server::Brick" # install dependency
  25. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions web-servers.md
    Original file line number Diff line number Diff line change
    @@ -47,16 +47,16 @@ $ 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
    * [/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)
    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"}]}]).'
  26. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion web-servers.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ 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)
    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"}]}]).'
  27. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions web-servers.md
    Original 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"}]}]).'
    ```
  28. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions web-servers.md
    Original 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
    ```
  29. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions web-servers.md
    Original 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**
    **Python 2.x**

    ```shell
    $ python -m SimpleHTTPServer 8000
    ```

    **python 3.x**
    **Python 3.x**

    ```shell
    $ python -m http.server 8000
    ```

    **ruby**
    **Ruby**

    Credit: http://barkingiguana.com/2010/04/11/a-one-line-web-server-in-ruby/

  30. @willurd willurd revised this gist Jun 6, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion web-servers.md
    Original 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**
    **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