Allow optional trailing slash

This commit is contained in:
Scott Schneider 2014-02-14 14:17:12 -08:00
parent c88961a76f
commit a4d15b703b

View file

@ -37,7 +37,7 @@ get '/' do
} }
end end
get '/dashboard/stats/vcloud/numbers' do get '/dashboard/stats/vcloud/numbers/?' do
result = Hash.new result = Hash.new
result['pending'] = 0 result['pending'] = 0
result['cloning'] = 0 result['cloning'] = 0
@ -62,7 +62,7 @@ get '/dashboard/stats/vcloud/numbers' do
JSON.pretty_generate(result) JSON.pretty_generate(result)
end end
get '/dashboard/stats/vcloud/pool' do get '/dashboard/stats/vcloud/pool/?' do
result = Hash.new result = Hash.new
$config[:pools].each do |pool| $config[:pools].each do |pool|
@ -114,7 +114,7 @@ get '/dashboard/stats/vcloud/pool' do
JSON.pretty_generate(result) JSON.pretty_generate(result)
end end
get '/dashboard/stats/vcloud/running' do get '/dashboard/stats/vcloud/running/?' do
result = Hash.new result = Hash.new
$config[:pools].each do |pool| $config[:pools].each do |pool|
@ -163,7 +163,7 @@ get '/dashboard/stats/vcloud/running' do
JSON.pretty_generate(result) JSON.pretty_generate(result)
end end
get '/vm' do get '/vm/?' do
content_type :json content_type :json
result = [] result = []
@ -175,7 +175,7 @@ get '/vm' do
JSON.pretty_generate(result) JSON.pretty_generate(result)
end end
get '/vm/:template' do get '/vm/:template/?' do
content_type :json content_type :json
result = {} result = {}
@ -185,7 +185,7 @@ get '/vm/:template' do
JSON.pretty_generate(result) JSON.pretty_generate(result)
end end
post '/vm/:template' do post '/vm/:template/?' do
content_type :json content_type :json
result = {} result = {}
@ -210,7 +210,7 @@ post '/vm/:template' do
JSON.pretty_generate(result) JSON.pretty_generate(result)
end end
delete '/vm/:hostname' do delete '/vm/:hostname/?' do
content_type :json content_type :json
result = {} result = {}