Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.0.1

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.mkd
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
Octocat-spinner-32 serve_dir.gemspec
README.mkd

serve_dir

Suppose you are practicing JavaScript and Ajax.

  • a.html
  • b.js
  • c.txt : loaded by b.js with Ajax

First you open a.html and notice c.txt can't be loaded:

XMLHttpRequest cannot load file:///somewhere/c.txt. Origin null is not allowed by Access-Control-Allow-Origin.

Then you can type

$ gem i serve_dir
$ serve_dir .

and open http://localhost:8181/a.html .

Requirements

Ruby 1.9 (Don't know if it works with 1.8)

Install

$ gem i serve_dir

Usage

serve_dir DIR [OPTIONS]

OPTIONS:

  • -p, --port=PORT : http port (default: 8181)
  • -O, --no-open : don't open browser (default: open browser automatically)
  • -h, --help : show help

License

MIT

Contact

https://github.com/yhara/serve_dir

Yutaka HARA (yhara)

twitter: @yhara_en

Something went wrong with that request. Please try again.