63489979e0
Modules for persistence, global dashboard control, managing workspaces, and keybindings. Server can save/load dashboards, merging workspaces if necessary. Config is stored as json in a file: ./ws/config.json, for now.
16 lines
324 B
Ruby
16 lines
324 B
Ruby
class Riemann::Dash::Static
|
|
def initialize(app, options = {})
|
|
@app = app
|
|
@root = options[:root] or raise ArgumentError, "no root"
|
|
@file_server = ::Rack::File.new(@root)
|
|
end
|
|
|
|
def call(env)
|
|
r = @app.call env
|
|
if r[0] < 200 or 400 <= r[0]
|
|
@file_server.call env
|
|
else
|
|
r
|
|
end
|
|
end
|
|
end
|