Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created August 26, 2011 18:17
Show Gist options
  • Save Raynos/1174035 to your computer and use it in GitHub Desktop.
Save Raynos/1174035 to your computer and use it in GitHub Desktop.
module.exports = {
"someMethod": ...
};
module.exports = function(app, model) {
// attach routes here
app.get("route", function(req, res) {
model.someMethod(function(data) {
res.render("thing", data);
});
});
});
module.exports = function (io, model) {
var channel = io.of(url);
io.on("foobar", function(socket) {
model.someMethod(function(data) {
socket.emit("data", data);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment