2017-10-05-local-ruby-server.md 645 B


title: "Local Ruby Server"

categories: bits

Browsers avoid executing anything originating directly from the file system. Rather than gem installing anything to serve a few files locally spin a WEBrick instance from the terminal using Ruby's Un{:rel="nofollow noopener noreferrer"} library.

$ cd dir/with/files
$ ruby -run -e httpd . -p 8080

Visit localhost:8080 to play with the served files.

Learn more about Un, reading it's, pretty much, hidden documentation{:rel="nofollow noopener noreferrer"}.