Merge pull request #10 from sschneid/trailing_slash_optional

Allow optional trailing slash
This commit is contained in:
Scott Schneider 2014-03-03 14:25:49 -08:00
commit b458f70d13

View file

@ -38,7 +38,7 @@ get '/' do
}
end
get '/dashboard/stats/vcloud/numbers' do
get '/dashboard/stats/vcloud/numbers/?' do
result = Hash.new
result['pending'] = 0
result['cloning'] = 0
@ -63,7 +63,7 @@ get '/dashboard/stats/vcloud/numbers' do
JSON.pretty_generate(result)
end
get '/dashboard/stats/vcloud/pool' do
get '/dashboard/stats/vcloud/pool/?' do
result = Hash.new
$config[:pools].each do |pool|
@ -115,7 +115,7 @@ get '/dashboard/stats/vcloud/pool' do
JSON.pretty_generate(result)
end
get '/dashboard/stats/vcloud/running' do
get '/dashboard/stats/vcloud/running/?' do
result = Hash.new
$config[:pools].each do |pool|
@ -164,7 +164,7 @@ get '/dashboard/stats/vcloud/running' do
JSON.pretty_generate(result)
end
get '/vm' do
get '/vm/?' do
content_type :json
result = []
@ -176,7 +176,7 @@ get '/vm' do
JSON.pretty_generate(result)
end
get '/vm/:template' do
get '/vm/:template/?' do
content_type :json
result = {}
@ -186,7 +186,7 @@ get '/vm/:template' do
JSON.pretty_generate(result)
end
post '/vm/:template' do
post '/vm/:template/?' do
content_type :json
result = {}
@ -211,7 +211,7 @@ post '/vm/:template' do
JSON.pretty_generate(result)
end
delete '/vm/:hostname' do
delete '/vm/:hostname/?' do
content_type :json
result = {}