Skip to content

Instantly share code, notes, and snippets.

@henriquemenezes
Created March 16, 2016 20:48
Show Gist options
  • Save henriquemenezes/cb8528078d1229ed7837 to your computer and use it in GitHub Desktop.
Save henriquemenezes/cb8528078d1229ed7837 to your computer and use it in GitHub Desktop.

Revisions

  1. henriquemenezes revised this gist Mar 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion one-line-web-server.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ $ http-server -p 8000
    ### NodeJS (node-static)

    ```shell
    $ npm install -g node-static # install dependency
    $ npm install -g node-static
    $ static -p 8000
    ```

  2. henriquemenezes created this gist Mar 16, 2016.
    61 changes: 61 additions & 0 deletions one-line-web-server.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,61 @@
    # One-line Web Servers

    ### Python 2.x

    ```shell
    python -m SimpleHTTPServer 8080
    ```
    ### Python 3.x

    ```shell
    python -m http.server 8080
    ```

    ### Ruby 1.9.2+

    ```shell
    ruby -run -e httpd . -p 8080
    ```

    ### PHP 5.4+

    ```shell
    php -S 0.0.0.0:8080
    ```

    ### NodeJS (http-server)

    ```shell
    $ npm install -g http-server
    $ http-server -p 8000
    ```
    ### NodeJS (node-static)

    ```shell
    $ npm install -g node-static # install dependency
    $ static -p 8000
    ```

    ### Go (spark)

    ```shell
    $ go get github.com/rif/spark
    $ spark -port 8000 .
    ```

    ### BusyBox

    ```shell
    $ busybox httpd -f -p 8000
    ```

    ### Webfsd

    ```shell
    $ webfsd -F -p 8000
    ```

    ## Credits

    - [Discussion on reddit](https://www.reddit.com/r/webdev/comments/1fs45z/list_of_ad_hoc_http_server_oneliners)
    - [willurd/web-servers.md gist](https://gist.github.com/willurd/5720255)