Created
January 24, 2015 19:26
-
-
Save mayfer/3f36ebd64f1515b03094 to your computer and use it in GitHub Desktop.
HTTP server response demo
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' | |
post '/' do | |
"You sent: #{params.inspect}" | |
end | |
get '/' do | |
<<-eos | |
<!doctype html> | |
<html> | |
<head> | |
<title>first webapp</title> | |
<form method="post"> | |
username: <input type="text" name="username" /> | |
<br /> | |
email: <input type="text" name="email" /> | |
<input type="submit" value="sheesh" /> | |
</form> | |
</head> | |
<body> | |
</body> | |
</html> | |
eos | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment