/webserving-made-easy

A list of various ways to easily serve files via HTTP.

Easy Webserving

Sometimes you want a dirt-simple way of serving one or more files via HTTP. You may be in the middle of developing some software and just want to easily test downloading a file, or often it's the easiest way to copy a file from your local machine, etc.

Below are multiple ways of doing so, separated by language.

I encourage you to open a pull request or issue to add to this list!

Go

  • go exec 'http.ListenAndServe(:8080, http.FileServer(http.Dir(.)))'
  1. Python 2

  • python -m SimpleHTTPServer <port#>

    supports GET, HEAD

    default port 8000

  • woof.py

    easy, one-time file servring (i.e. quits after file is downloaded)

    when run will display URL where file is served

Python 3

  • python3 -m http.server <port#>

    default port 8000

Ruby

  • ruby -run -e httpd . <-p port#>

    default port 880

Rust

  • microserver

    cargo install microserver

    From the command line: microserver <path/to/folder>

    Will serve single single page applications