Skip to content

Instantly share code, notes, and snippets.

@beresmate
Created October 18, 2013 02:38
Show Gist options
  • Save beresmate/7035674 to your computer and use it in GitHub Desktop.
Save beresmate/7035674 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 ioMixin = function (req, res, next, fn) {
io.sockets.once('connection', function (socket) {
fn(req, res, socket);
});
};
app.get('/', views.index);
app.get('/api/tracks', library.list);
app.get('/api/updatelib', _.partialRight(ioMixin, library.update));
// app.get('/api/updatelib', function (req, res) {
// io.sockets.once('connection', function (socket) {
// library.update(req, res, socket);
// });
// });
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment