Add JSON endpoint for /env
All checks were successful
Gitea Actions Demo / release-image (push) Successful in 1m3s
All checks were successful
Gitea Actions Demo / release-image (push) Successful in 1m3s
This commit is contained in:
parent
6802c59f1d
commit
c8372cec1c
6
app.rb
6
app.rb
@ -210,6 +210,12 @@ get "/" do
|
|||||||
"hello there!\n"
|
"hello there!\n"
|
||||||
end
|
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
|
get "/env" do
|
||||||
stream do |out|
|
stream do |out|
|
||||||
ENV.sort.each do |k, v|
|
ENV.sort.each do |k, v|
|
||||||
|
Loading…
Reference in New Issue
Block a user