Skip to content

Instantly share code, notes, and snippets.

@beresmate
Created October 18, 2013 02:59
Show Gist options
  • Save beresmate/7035841 to your computer and use it in GitHub Desktop.
Save beresmate/7035841 to your computer and use it in GitHub Desktop.
/* global module, require */
(function () {
'use strict';
var library = require('./../app/controllers/library'),
views = require('./../app/controllers/views'),
_ = require('lodash');
module.exports = function (app, io) {
var withIO = function (fn) {
return _.partialRight(function (req, res, next, fn) {
io.sockets.once('connection', function (socket) {
fn(req, res, socket);
});
}, fn);
};
app.get('/', views.index);
app.get('/api/tracks', library.list);
app.get('/api/updatelib', withIO(library.update));
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment