mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-16 00:03:37 -04:00
35 lines
421 B
Ruby
35 lines
421 B
Ruby
require 'rubygems'
|
|
require 'sinatra'
|
|
|
|
get '/hello_world' do
|
|
'hello world'
|
|
end
|
|
|
|
get '/json' do
|
|
"[1,2,3]"
|
|
end
|
|
|
|
post '/hello' do
|
|
"hello #{params[:name]}"
|
|
end
|
|
|
|
get '/hello' do
|
|
"hello #{params[:name]}"
|
|
end
|
|
|
|
post '/echo_name' do
|
|
params[:name].inspect
|
|
end
|
|
|
|
put '/echo_name' do
|
|
params[:name].inspect
|
|
end
|
|
|
|
delete '/delete_with_json' do
|
|
%/{"deleted":true}/
|
|
end
|
|
|
|
delete '/delete_with_params' do
|
|
params[:deleted]
|
|
end
|