This repository has been archived by the owner on Dec 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Basic Usage
Tony Arcieri edited this page Sep 15, 2013
·
4 revisions
Since reel-rack
is a Rack-based web server, we need to make a config.ru
(a.k.a. "rackup") file for it to serve. We'll use the following one:
# config.ru
run Proc.new {|env| [200, {"Content-Type" => "text/html"}, "Hello Rack!"]}
Now we need to install the reel-rack
gem to serve this "application":
$ gem install reel-rack
Fetching: timers-1.1.0.gem (100%)
Successfully installed timers-1.1.0
Fetching: celluloid-0.15.1.gem (100%)
Successfully installed celluloid-0.15.1
Fetching: nio4r-0.5.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed nio4r-0.5.0
Fetching: celluloid-io-0.15.0.gem (100%)
Successfully installed celluloid-io-0.15.0
Fetching: http_parser.rb-0.6.0.beta.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed http_parser.rb-0.6.0.beta.2
Fetching: http-0.5.0.gem (100%)
Successfully installed http-0.5.0
Fetching: websocket_parser-0.1.4.gem (100%)
Successfully installed websocket_parser-0.1.4
Fetching: reel-0.4.0.gem (100%)
Successfully installed reel-0.4.0
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: reel-rack-0.0.2.gem (100%)
Successfully installed reel-rack-0.0.2
Once the reel-rack
has been installed, we can start Reel by running the associated command:
$ reel-rack config.ru
I, [2013-09-14T23:40:14.556975 #7674] INFO -- : A Reel good HTTP server! (Codename "Garbo")
I, [2013-09-14T23:40:14.557065 #7674] INFO -- : Listening on http://0.0.0.0:3000
We now have our "Hello Rack!" application listening on port 3000. We can confirm it's running using a tool like curl:
$ curl http://0.0.0.0:3000
Hello Rack!