Commit b5d80c3b authored by John E. Vincent's avatar John E. Vincent

adding json index page

parent 80a2b3f9
......@@ -45,9 +45,8 @@ module Noah
end
# Displays an overview page of all registered objects
get '/' do
get '/', :provides => :html do
content_type "text/html"
haml :index, :format => :html5, :locals => {:redis_version => Ohm.redis.info["redis_version"].to_s, :noah_version => Noah::VERSION}
end
......@@ -56,7 +55,7 @@ module Noah
erb :'index.json', :locals => {:redis_version => Ohm.redis.info["redis_version"].to_s, :noah_version => Noah::VERSION}
end
get '/version' do
get '/version', :provides => :json do
content_type "application/json"
{:redis_version => Ohm.redis.info["redis_version"].to_s, :noah_version => Noah::VERSION}.to_json
end
......
{
"redis_verion":"<%= locals[:redis_version] %>",
"noah_version":"<%= locals[:noah_version] %>",
"resources":{
"hosts":{"link":"<%= request.url %>hosts"}
"services":{"link":"<%= request.url %>services"}
"applications":{"link":"<%= request.url %>applications"}
"configurations":{"link":"<%= request.url %>configurations"}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment