Created
April 7, 2014 01:47
-
-
Save JesseHerrick/10013727 to your computer and use it in GitHub Desktop.
This file contains 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
# file: rest-server.rb | |
require 'sinatra' | |
# all status codes given are based on W3C standards | |
get '/' do | |
'Here is some data.' | |
end | |
post '/' do | |
puts "Data: '#{params[:foo]}' recieved, creating object." | |
status 201 | |
end | |
put '/' do | |
puts "Data: '#{params[:foo]}' recieved, updating object." | |
end | |
delete '/' do | |
puts 'Deleting data.' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment