Permalink
Browse files

Update for newest Node.js

  • Loading branch information...
1 parent ffa0f68 commit 7329b02688fdaa777f5ed4e92077fd22f33c83d9 Brandon Tilley committed Dec 12, 2013
Showing with 11 additions and 7 deletions.
  1. +5 −4 lib/live-twitter-map.coffee
  2. +6 −3 package.json
View
9 lib/live-twitter-map.coffee
@@ -1,6 +1,7 @@
fs = require 'fs'
sys = require 'sys'
path = require 'path'
+http = require 'http'
express = require 'express'
io = require 'socket.io'
twitter = require 'ntwitter'
@@ -19,18 +20,18 @@ exports.LiveTwitterMap = class LiveTwitterMap
@backlog = []
create_web_server: (port) =>
- pubDir = path.join path.dirname(fs.realpathSync(__filename)), './public'
+ pubDir = path.resolve __dirname + '/public'
# Set up the Express web server
- app = express.createServer()
+ app = express()
app.configure ->
app.use express.static pubDir
# The client web page
app.get '/', (req, res) ->
res.sendfile path.join pubDir, "client.htm"
- app.listen port
+ server = http.createServer(app).listen port
# Attach Socket.IO to the web server
- @socket = io.listen app
+ @socket = io.listen server
@socket.set 'log level', 1
@socket.on 'connection', (socket) =>
console.log "New connection"
View
9 package.json
@@ -13,6 +13,9 @@
"type": "git",
"url": "git://github.com/BinaryMuse/live-twitter-map.git"
},
+ "scripts": {
+ "start": "./bin/twimap.js"
+ },
"engines": {
"node": ">= 0.4.0"
},
@@ -24,9 +27,9 @@
"twimap": "./bin/twimap.js"
},
"dependencies": {
- "socket.io": "~0.9.6",
+ "coffee-script": "~1.6.3",
"ntwitter": "~0.5.0",
- "coffee-script": "~1.3.1",
- "express": "~2.5.9"
+ "socket.io": "~0.9.16",
+ "express": "~3.4.7"
}
}

0 comments on commit 7329b02

Please sign in to comment.