Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

UnderRack is just a Ruby Framework for you understand Rack

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 under_rack.gemspec
README.rdoc

UnderRack

A simple Ruby Framework for you understand Rack(Ruby Webserver Interface)

Example

  • gem install under_rack

  • create a new file called app.ru with:

    require "rubygems"
    require "under_rack"
    
    get "/hello" do
      @name = "Mary"
      erb :hello
    end
    
    post "/create" do
      "Created"
    end
    
    app_root = get "/" do
     "Home"
    end
    
    run app_root
  • Create a new file called hello.erb with:

    <p>Hello <%= @name %></p>
  • Run the application with: rackup app.ru

  • Go to localhost:9292/hello

Something went wrong with that request. Please try again.