Skip to content

Instantly share code, notes, and snippets.

@irohiroki
Created October 28, 2011 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irohiroki/1322662 to your computer and use it in GitHub Desktop.
Save irohiroki/1322662 to your computer and use it in GitHub Desktop.
A sinatra server that accepts POSTs from anywhere(!) ... and disposes them ;p
require 'sinatra'
configure do
set :port, 9999
end
allow_all = {
'Access-Control-Allow-Headers' => 'X-Requested-With, X-File-Name, Content-Type',
'Access-Control-Allow-Origin' => '*',
}
options '/bogus' do
headers allow_all
end
post '/bogus' do
headers allow_all
body '{"success":true,"hash":"8f5110383049cf6ed31a049fa9d003fd2a0b8c51"}'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment