Skip to content

Instantly share code, notes, and snippets.

@auxesis
Forked from ChrisLundquist/gist:3898403
Created October 16, 2012 09:54
Show Gist options
  • Save auxesis/3898419 to your computer and use it in GitHub Desktop.
Save auxesis/3898419 to your computer and use it in GitHub Desktop.
before do
content_type :jsonp
@backend = Visage::Config.backend
end
# /data/:host/:plugin/:optional_plugin_instance
get %r{/data/([^/]+)/([^/]+)((/[^/]+)*)} do
# parameter unpacking
options = {
:host => host,
:plugin => plugin,
:instances => instances,
:start => start,
:finish => finish,
:percentiles => percentiles,
:resolution => resolution
}
json = @backend.json(options)
maybe_wrap_with_callback(json)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment