Add Student Sonar backend code.
Review Request #6896 — Created Feb. 3, 2015 and submitted
This contains several pieces:
- server.js and lib/routes.js define the basic web server side of things. There
are currently a few API endpoints, and navigating to / will deliver an HTML
page (which is included in the frontend change). - lib/slack.js has code to query our Slack logs from Amazon DynamoDB, as well
as get the user list from the Slack API. - lib/students.js has code to load the students.json file as well as merge in
Slack avatars. - lib/reviewboard.js has code to query the Review Board API.
Exercised all of this via the frontend.
Description | From | Last Updated |
---|---|---|
With ES6 let, you don't need to declare your variables at the top of the functions anymore. Just declare when … |
mike_conley | |
If you're going full-on ES6, I think you can use for-of: for (let item of logs.Items) { // ... } … |
mike_conley | |
Worth pulling this port number from the config.js file as well? |
mike_conley |
-
-
With ES6 let, you don't need to declare your variables at the top of the functions anymore. Just declare when you need them.
-
If you're going full-on ES6, I think you can use for-of:
for (let item of logs.Items) { // ... }
Alternatively, since you're mapping from the log items to an array of results, I think you could use:
let result = logs.Items.map(function(item) { let timestamp = moment.unix(parseFloat(item.timestamp.S)).startOf('day'); return { channel_name: item.channel_name.S, text: item.text.S, timestamp: timestamp.unix() }; });
-
- Branch:
-
backendmaster
- Commit:
-
a62b89b1ad15399199349114b0019597ade6d74dd5477b4c889b0a3f071686b00c861c41a88e1c7e