Created
July 13, 2015 17:58
-
-
Save mayfer/24dfc1b820f14cc926d8 to your computer and use it in GitHub Desktop.
Intro to HTTP
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
require 'sinatra' | |
get '/' do | |
# whatever happens here happens on every request | |
puts "goodbye world" | |
response = "hello #{params[:username]} \n\n \ | |
<form method='post'> | |
<input type='text' name='absolutely_nothing' placeholder='type something' /> | |
<input type='submit' value='Submit' /> | |
</form>" | |
response | |
end | |
post '/' do | |
params.to_s | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment