Commit 96bea022 authored by Leo Iannacone's avatar Leo Iannacone

handling get packages

parent 7dcaf7ac
......@@ -6,7 +6,7 @@
var express = require('express')
, routes = require('./routes')
, config = require('./config.js')
, send = require('./send.js')()
, send = require('./send.js')
, fs = require('fs')
var app = module.exports = express.createServer();
......@@ -36,10 +36,9 @@ var io = require('socket.io').listen(app);
app.get('/', routes.index);
io.sockets.on('connection', function(socket) {
send.distributions(io.sockets);
socket.on('get-distribution', function(from, distro) {
console.log(from + " " + distro)
send.distribution(from, distro);
send.distributions(socket);
socket.on('get-packages', function(distro) {
send.packages_list(socket, distro);
});
});
......
......@@ -9,7 +9,7 @@
function get_path(path) {
info = path.split('/');
if (info.length == 1) {
socket.emit("get-distribution", path);
socket.emit("get-packages", path);
}
}
var socket = io.connect('//localhost:3000');
......@@ -21,6 +21,11 @@
});
});
socket.on('packages', function(packages) {
console.log("HHHH");
console.log(packages);
});
socket.on('error', function() { console.error(arguments) });
$(window).on('hashchange', function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment