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
# Lets create a simple calculator app together, it should have a get method for localhost:4567/calculator that displays two forms | |
# the first form should post (note that post is one of those http methods) to localhost:4567/add, and have two fields named "num1" and "num2" | |
# the second form should post to localhost:4567/subtract with the same args | |
# the page that they go to should display the result, and have a link to get back to calculator | |
require 'rubygems' | |
require 'sinatra' | |
get '/calculator' do | |
' |