Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Noah
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Noah
Commits
b5d80c3b
Commit
b5d80c3b
authored
Oct 08, 2011
by
John E. Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding json index page
parent
80a2b3f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
app.rb
lib/noah/app.rb
+2
-3
index.json.erb
views/index.json.erb
+10
-0
No files found.
lib/noah/app.rb
View file @
b5d80c3b
...
...
@@ -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
...
...
views/index.json.erb
0 → 100644
View file @
b5d80c3b
{
"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"}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment