Add JSON endpoint for /env
All checks were successful
Gitea Actions Demo / release-image (push) Successful in 1m3s

This commit is contained in:
Ryan Cavicchioni 2024-07-04 02:01:38 -05:00
parent 6802c59f1d
commit c8372cec1c
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

6
app.rb
View File

@ -210,6 +210,12 @@ get "/" do
"hello there!\n"
end
get "/env", provides: "json" do
return JSON.pretty_generate ENV.sort.to_h if params.key? "pretty"
JSON.generate ENV.sort.to_h
end
get "/env" do
stream do |out|
ENV.sort.each do |k, v|