Created
October 18, 2013 02:38
-
-
Save beresmate/7035674 to your computer and use it in GitHub Desktop.
This file contains 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
/* 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