Skip to content

Instantly share code, notes, and snippets.

@mayfer
Created January 24, 2015 19:26
Show Gist options
  • Save mayfer/3f36ebd64f1515b03094 to your computer and use it in GitHub Desktop.
Save mayfer/3f36ebd64f1515b03094 to your computer and use it in GitHub Desktop.
HTTP server response demo
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