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:
parent
ec5e4649b0
commit
8aa51eee67
@ -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 \
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
##############################################################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user