Skip to content

Instantly share code, notes, and snippets.

@mwilc0x
Created February 7, 2014 02:38
Show Gist options
  • Save mwilc0x/8856555 to your computer and use it in GitHub Desktop.
Save mwilc0x/8856555 to your computer and use it in GitHub Desktop.
var express = require("express"),
http = require("http"),
app = express(),
port = process.env.PORT || 3000,
socketio = require('socket.io'),
imdb = require('imdb-api');
app.use(express.static(__dirname + '/dist'));
var server = http.createServer(app);
server.listen(port);
console.log('http server listening on %d', port);
var io = socketio.listen(server);
io.sockets.on('connection', function(socket) {
var movie;
imdb.getReq({ name: 'The Toxic Avenger' }, function(err, things) {
movie = things;
console.log(movie);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment