- node_modules // auto generated
- lib // generic library code that can't be done with npm
- src
- models // database code
- routes // express routing
- IO // socket.io files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Core.request("router").success(function(app) { | |
// bind routes | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (mediator) { | |
mediator.once('boot.ready', f); | |
}; | |
var f = function() { | |
//UGH! MAKES EVERY MODULE CODE START WITH 1 INDENTS... solution? | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTTP redirect | |
app.get("/", redirectToRooms); | |
// Return HTML page | |
app.get("/faq", renderFAQ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
_id: uuid, | |
user: String, | |
text: String, | |
room: uuid, // id of room | |
starred: [String] // id or name of users | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//server | |
of('/room/:id/details') | |
emit('roomUpdated', { | |
details: { | |
} | |
}, delay); | |
//client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
"someMethod": ... | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MessageModel = { | |
"get": function (messageId, cb) { | |
cb(err, messageObject) | |
} | |
"update": function(messageId, obj, cb) { | |
cb(err, messageObject) | |
} | |
"getStars": function(count, from, to, cb) { | |
cb(err, arrayOfStarredMessages) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get("/rooms", function(req, res) { | |
Room.getRange(0, -1, function(err, data) { | |
var cb = after(data.length, function() { | |
var rooms = Array.prototype.sort.call(arguments, function(a, b) { | |
return a.id < b.id; | |
}); | |
res.render("rooms/index", { | |
rooms: rooms, | |
categories: {} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// start bootstrap | |
require("../bootstrap.js"); | |
// wait for app | |
var app; | |
// if ready set app | |
mediator.on('server.listening', function(server) { | |
app = server; | |
}); |