0.0
No commit activity in last 3 years
No release in over 3 years
Sinatra extension to give routes their own path
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.6.2

Runtime

~> 1.4.2
 Project Readme

Sinatra Whoami

Extension that adds the original route signature to the sinatra.route env so that you can log it for better endpoint-specific metrics, monitoring and alerting.

In future versions of Sinatra (possibly 1.5 and above) this will be built-in.

Usage

require "sinatra/whoami"

class MyApplication < Sinatra::Base
  register Sinatra::Whoami

  after do
    log route: env["sinatra.route"] # ie "/products/:id/photos"
  end
end

License

Released under the MIT License.

About

Thanks Konstantin Haase for the support.