From 312e570a02fb29645c7424fc2151a545bb10316b Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Tue, 25 Mar 2025 18:48:25 -0500 Subject: [PATCH] add /_cat to list all of the other /_cat sub-endpoints --- app.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app.rb b/app.rb index be2735b..3aab406 100644 --- a/app.rb +++ b/app.rb @@ -417,6 +417,20 @@ get "/config", provides: "json" do jsonify config.as_json, pretty: end +get "/_cat" do + stream do |out| + out << "=^.^=\n" + x = Sinatra::Application.routes.map do |method, route| + route.map do |route| + route.first.to_s + end + end + x.flatten.sort.uniq.each do |route| + out << "#{route}\n" if route.start_with? "/_cat" + end + end +end + get "/_cat/headers" do stream do |out| req_headers.each do |k, v|