1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-03 13:47:01 +03:00

feature #1398: Add custom routes to Sunstone

This commit is contained in:
Daniel Molina 2012-08-01 10:16:18 +02:00
parent ec5e4649b0
commit 8aa51eee67
3 changed files with 32 additions and 1 deletions

View File

@ -248,7 +248,8 @@ VAR_DIRS="$VAR_LOCATION/remotes \
$VAR_LOCATION/remotes/auth/server_cipher \
$VAR_LOCATION/remotes/auth/dummy"
SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \
SUNSTONE_DIRS="$SUNSTONE_LOCATION/custom_routes \
$SUNSTONE_LOCATION/models \
$SUNSTONE_LOCATION/models/OpenNebulaJSON \
$SUNSTONE_LOCATION/public \
$SUNSTONE_LOCATION/public/js \

View File

@ -92,3 +92,24 @@
# Marketplace endpoint
#
:marketplace_url: https://marketplace.c12g.com/appliance
################################################################################
# Custom routes
################################################################################
# Array of files containing ruby code to extend the default sunstone-server
# routes. These files must be placed inside the custom_routes directory
# in the sunstone root dir (/usr/lib/one/sunstone/custom_rotues)
#
# Example:
# $ ls /usr/lib/one/sunstone/custom_routes
# custom.rb other.rb
#
# $ cat /usr/lib/one/sunstone/custom_routes/example.rb
# get '/custom' do
# body "It works"
# end
#
#:custom_routes:
# - custom
# - other

View File

@ -205,6 +205,15 @@ after do
end
end
##############################################################################
# Custom routes
##############################################################################
if settings.config[:custom_routes]
settings.config[:custom_routes].each { |route|
require "custom_routes/#{route}"
}
end
##############################################################################
# HTML Requests
##############################################################################