From 7d73610eb76a4ca65818289b2927eadfa23fcff7 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 5 Mar 2013 15:55:49 +0100 Subject: [PATCH] feature #1370: make sunstone server compatible with rackup --- src/sunstone/config.ru | 12 ++++++++++++ src/sunstone/sunstone-server.rb | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 src/sunstone/config.ru diff --git a/src/sunstone/config.ru b/src/sunstone/config.ru new file mode 100755 index 0000000000..e74952d454 --- /dev/null +++ b/src/sunstone/config.ru @@ -0,0 +1,12 @@ + +# If you are using self contained installation set this variable to the +# install location +#ENV['ONE_LOCATION']='/path/to/OpenNebula/install' + +WITH_RACKUP=true + +$: << '.' +require 'sunstone-server' + +run Sinatra::Application + diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index d31ca9a7a7..35eac27f14 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -408,4 +408,5 @@ post '/:resource/:id/action' do request.body.read) end -Sinatra::Application.run! +Sinatra::Application.run! if(!defined?(WITH_RACKUP)) +