add /_cat to list all of the other /_cat sub-endpoints
This commit is contained in:
parent
d6b1ed1046
commit
312e570a02
14
app.rb
14
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|
|
||||
|
Loading…
x
Reference in New Issue
Block a user