From f095be9b1abcb5c5df1b36aba72b2be6d6ae07ae Mon Sep 17 00:00:00 2001 From: Radek Stepan Date: Tue, 22 May 2012 17:29:38 +0100 Subject: [PATCH] nice minimal example node server serving outstanding issues --- app.coffee | 10 +- index.html | 228 ------------------------------------------- templates/index.eco | 12 --- templates/issues.eco | 93 ++++++++++++++++++ 4 files changed, 98 insertions(+), 245 deletions(-) delete mode 100644 index.html delete mode 100644 templates/index.eco create mode 100644 templates/issues.eco diff --git a/app.coffee b/app.coffee index d682d0b..fff0dec 100644 --- a/app.coffee +++ b/app.coffee @@ -33,15 +33,15 @@ app.configure 'production', -> app.use express.errorHandler() # Routes -app.get '/', (req, res) -> +app.get '/issues', (req, res) -> https.request(options, (response) -> if response.statusCode is 200 - str = "" - response.on "data", (chunk) -> str += chunk + json = "" + response.on "data", (chunk) -> json += chunk response.on "end", -> - res.render 'index', - 'issues': str + res.render 'issues', + 'issues': JSON.parse json , (html) -> res.send html, 'Content-Type': 'text/html', 200 ).end() diff --git a/index.html b/index.html deleted file mode 100644 index 3d7bf63..0000000 --- a/index.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - GitHub Issues Burndown Chart - - - - - - - - - - -
-
- - -
- -
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#DateTitleDescriptionAmount DueActions
14/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
24/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
34/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
44/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
54/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
64/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
74/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
84/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
94/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
104/3/12Yammer-DesignDesign new logo for Yammer.Inc$450 -
- - - -
-
-
-
-
-
-
- - \ No newline at end of file diff --git a/templates/index.eco b/templates/index.eco deleted file mode 100644 index f948594..0000000 --- a/templates/index.eco +++ /dev/null @@ -1,12 +0,0 @@ - - - - Express - - - -

Express

-

Welcome to Express

- <%- @issues %> - - \ No newline at end of file diff --git a/templates/issues.eco b/templates/issues.eco new file mode 100644 index 0000000..4677e74 --- /dev/null +++ b/templates/issues.eco @@ -0,0 +1,93 @@ + + + + + + + Burndown App + + + + + + + + + + +
+
+ + +
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + <% for issue in @issues: %> + + + + + + + + + + <% end %> + +
#TitleOpenedUpdatedOpened ByAssigned ToActions
<%= issue.number %><%= issue.title %><%= issue.created_at %><%= issue.updated_at %><%= issue.user.login %><%= issue.assignee?.login %> + + + +
+
+
+
+
+
+ + \ No newline at end of file