risseraka/node-sichuan-mahjong — Issue #1: Crash on get (localhost:8080)
Author: mandrake73
Created: 2011-12-06 13:27:30+00:00
State: open

Mac OSX Lion
Chrome 15.0.864
node 0.6.5

Pomme:risseraka-node-sichuan-mahjong-ef197dd mandrake7373$ node server.js
Adding route: [ '', 'home' ]
Adding route: [ '', 'majiang' ]
Adding route: [ '', 'games' ]
Adding route: /^\/([^\.]+)\.([^\.]+$)/
Adding route: /ui
GOT /favicon.ico

/Users/mandrake7373/Downloads/risseraka-node-sichuan-mahjong-ef197dd/server.js:166
router.defaultNotFound(req, res);
^
TypeError: Object function router(req, res) {
var path = parse(req.url).pathname,
_routes = routes[req.method];
if (_routes != undefined) {
len = _routes.length;
for (var i = 0; i < len; i += 1) {
//say '/foo/bar/baz' matches '/foo/*/*'
var route = _routes[i],
matches = route.exec(path);
if (matches) { //then matches would be ['/foo/bar/baz','bar','baz']
//so turn arguments from [req,res] into [req,res,'bar','baz']
Array.prototype.push.apply(arguments, matches.slice(1));
console.log("GOT", arguments[0].url);
return route.callback.apply(this, arguments);
}
}
}
//route not found: no route has matched and hence returned yet
router.notFound.apply(this, arguments);
} has no method 'defaultNotFound'
at Server.handleFiles (/Users/mandrake7373/Downloads/risseraka-node-sichuan-mahjong-ef197dd/server.js:166:20)
at Server.router (/Users/mandrake7373/Downloads/risseraka-node-sichuan-mahjong-ef197dd/choreographer.js:18:43)
at Server.servStart (/Users/mandrake7373/Downloads/risseraka-node-sichuan-mahjong-ef197dd/server.js:4:12)
at Server.emit (events.js:70:17)
at HTTPParser.onIncoming (http.js:1478:12)
at HTTPParser.onHeadersComplete (http.js:102:31)
at Socket.ondata (http.js:1374:22)
at TCP.onread (net.js:336:27)