Add sane sinatra defaults for the web services
This commit is contained in:
@@ -7,6 +7,11 @@ module SharpCoin
|
|||||||
#
|
#
|
||||||
# @author Nick Thomas <nick@lupine.me.uk>
|
# @author Nick Thomas <nick@lupine.me.uk>
|
||||||
class JsonRpc < Sinatra::Base
|
class JsonRpc < Sinatra::Base
|
||||||
|
set :environment, :production
|
||||||
|
disable :sessions, :logging, :run, :dump_errors, :raise_errors, :lock
|
||||||
|
enable :method_override, :static, :show_exceptions
|
||||||
|
|
||||||
|
set :root, File.join(File.dirname(__FILE__), 'web')
|
||||||
end
|
end
|
||||||
JsonRPC = JsonRpc
|
JsonRPC = JsonRpc
|
||||||
JSONRPC = JsonRpc
|
JSONRPC = JsonRpc
|
||||||
|
@@ -7,6 +7,11 @@ module SharpCoin
|
|||||||
#
|
#
|
||||||
# @author Nick Thomas <nick@lupine.me.uk>
|
# @author Nick Thomas <nick@lupine.me.uk>
|
||||||
class Rest < Sinatra::Base
|
class Rest < Sinatra::Base
|
||||||
|
set :environment, :production
|
||||||
|
disable :sessions, :logging, :run, :dump_errors, :raise_errors, :lock
|
||||||
|
enable :method_override, :static, :show_exceptions
|
||||||
|
|
||||||
|
set :root, File.join(File.dirname(__FILE__), 'web')
|
||||||
end
|
end
|
||||||
REST = Rest
|
REST = Rest
|
||||||
end
|
end
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
require 'sinatra/base'
|
require 'sinatra/base'
|
||||||
|
require 'sharp-coin/interface/json-rpc'
|
||||||
require 'sharp-coin/interface/rest'
|
require 'sharp-coin/interface/rest'
|
||||||
|
|
||||||
module SharpCoin
|
module SharpCoin
|
||||||
@@ -12,13 +13,17 @@ module SharpCoin
|
|||||||
#
|
#
|
||||||
# @author Nick Thomas <nick@lupine.me.uk>
|
# @author Nick Thomas <nick@lupine.me.uk>
|
||||||
class WebReal < Sinatra::Base
|
class WebReal < Sinatra::Base
|
||||||
|
set :environment, :production
|
||||||
end
|
disable :sessions, :logging, :run, :dump_errors, :raise_errors, :lock
|
||||||
|
enable :method_override, :static, :show_exceptions
|
||||||
|
|
||||||
|
set :root, File.join(File.dirname(__FILE__), 'web')
|
||||||
|
end
|
||||||
|
|
||||||
Web = Rack::Builder.new do
|
Web = Rack::Builder.new do
|
||||||
map("/api/rpc/") { run JsonRPC }
|
map("/api/rpc/") { run JsonRPC }
|
||||||
map("/api/rest/") { run REST }
|
map("/api/rest/") { run REST }
|
||||||
map("/") { run WebReal }
|
map("/") { run WebReal }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user