Revision 72cf4c2f

View differences:

install.sh
248 248
          $VAR_LOCATION/remotes/auth/server_cipher \
249 249
          $VAR_LOCATION/remotes/auth/dummy"
250 250

  
251
SUNSTONE_DIRS="$SUNSTONE_LOCATION/custom_routes \
251
SUNSTONE_DIRS="$SUNSTONE_LOCATION/routes \
252 252
               $SUNSTONE_LOCATION/models \
253 253
               $SUNSTONE_LOCATION/models/OpenNebulaJSON \
254 254
               $SUNSTONE_LOCATION/public \
src/sunstone/etc/sunstone-server.conf
96 96
:marketplace_url: https://marketplace.c12g.com/appliance
97 97

  
98 98
################################################################################
99
# Custom routes
99
# Routes
100 100
################################################################################
101 101

  
102 102
# Array of files containing ruby code to extend the default sunstone-server
103 103
#   routes. These files must be placed inside the custom_routes directory
104
#   in the sunstone root dir (/usr/lib/one/sunstone/custom_rotues)
104
#   in the sunstone root dir (/usr/lib/one/sunstone/routes)
105 105
#
106 106
# Example:
107
#   $ ls /usr/lib/one/sunstone/custom_routes
107
#   $ ls /usr/lib/one/sunstone/routes
108 108
#   custom.rb  other.rb
109 109
#
110
#   $ cat /usr/lib/one/sunstone/custom_routes/example.rb
110
#   $ cat /usr/lib/one/sunstone/routes/example.rb
111 111
#   get '/custom' do
112 112
#       body "It works"
113 113
#   end
114 114
#
115
#:custom_routes:
115
#:routes:
116 116
#    - custom
117 117
#    - other
src/sunstone/sunstone-server.rb
197 197
##############################################################################
198 198
# Custom routes
199 199
##############################################################################
200
if settings.config[:custom_routes]
201
    settings.config[:custom_routes].each { |route|
202
        require "custom_routes/#{route}"
200
if settings.config[:routes]
201
    settings.config[:routes].each { |route|
202
        require "routes/#{route}"
203 203
    }
204 204
end
205 205

  

Also available in: Unified diff