start running Sinatra

require "sinatra"
get "/" do
  puts "you requested the root path"
end

Here we go!

require "sinatra"
get "/" do
  "you requested the root path"
end

get "/about" do
  "this app is our first Sinatra App!"
end

get "/roll-die" do
  "Your die roll is...#{rand(1...7)}"
end

a

use variable in routing

require "sinatra"
get "/r/SUBREDDIT_NAME/POST_ID/POST_TITLE" do
  "this is a post"
end

getting a patter with post

require "sinatra"

get "/greet/:name" do
  "Hello there #{params[:name]}!"
end

Think about capitalize

get "/greet/:name" do
  name = params[:name].capitalize
  "Hello there #{name}!"
end

try out this

get "/square/:num" do
  num = params[:num].to_i
  num * num
end