Skip to content

Instantly share code, notes, and snippets.

@chintanparikh
Created July 1, 2013 17:39
Show Gist options
  • Save chintanparikh/5902921 to your computer and use it in GitHub Desktop.
Save chintanparikh/5902921 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'docsplit'
require './sinatra/faxattach_helpers'
class FaxAttach < Sinatra::Base
helpers Sinatra::FaxAttachHelpers
get '/*' do
"hello world"
status 405
end
put '/*' do
status 405
end
patch '/*' do
status 405
end
delete '/*' do
status 405
end
options '/*' do
status 405
end
link '/*' do
status 405
end
unlink '/*' do
status 405
end
post '/process' do
path = params[:path]
begin
debugger
file = test_download path
rescue
status 404
end
debugger
code = extractCode file
code
end
end
curl --data "path=https://aidin.s3.amazonaws.com/aidin/staging/attachments/faxattach/4yhTuv1W3qRCSA1M2?AWSAccessKeyId=AKIAJPBOMKHDQ5WNJM3Q&Expires=1373295474&Signature=2meFoWGPo4XFC1bPHjmxADd7FDo%3D" localhost:4567/process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment