Created
October 3, 2014 18:16
-
-
Save mzemel/64da9dc30efe0e330d83 to your computer and use it in GitHub Desktop.
Sinatra Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem install sinatra | |
# sinatra.rb | |
require 'rubygems' | |
require 'sinatra' | |
get "/" do | |
"This is the main page" | |
end | |
get "/first" do | |
"This is the first page" | |
end | |
get "/second" do | |
name = params[:name] | |
"Hello, #{name}. This is the second page" | |
end | |
# ruby sinatra.rb | |
# == Sinatra/1.4.5 has taken the stage on 4567 for development with backup from Thin | |
# Thin web server (v1.6.2 codename Doc Brown) | |
# Maximum connections set to 1024 | |
# Listening on localhost:4567, CTRL+C to stop | |
# visit localhost:4567 | |
# see "This is the main page" | |
# etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment