-
-
Save alejandro/1346996 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
› node server.js | |
The "sys" module is now called "util". It should have a similar interface. | |
node.js:201 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
TypeError: object is not a function | |
at EventEmitter.CALL_NON_FUNCTION (native) | |
at Object.<anonymous> (/home/rex/Projects/foilr/lib/server.js:10:3) | |
at Object.<anonymous> (/home/rex/Projects/foilr/lib/server.js:11:4) | |
at Module._compile (module.js:432:26) | |
at Object..js (module.js:450:10) | |
at Module.load (module.js:351:31) | |
at Function._load (module.js:310:12) | |
at Array.0 (module.js:470:10) | |
at EventEmitter._tickCallback (node.js:192:40) |
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
(function() { | |
var cluster, connect, main, portfolio,http,numCPUs, server; | |
http = require('http'); | |
cluster = require('cluster'); | |
connect = require('connect'); | |
numCPUs = require('os').cpus().length; | |
main = require('./main/app'); | |
portfolio = require('./portfolio/app'); | |
// server = connect(); This is not rigth... | |
server.use(connect.vhost('foilr.com', main)); | |
server.use(connect.vhost('*', portfolio)); | |
if (cluster.isMaster) { | |
for (var i = 0; i < numCPUs; i++) { | |
cluster.fork(); | |
} | |
cluster.on('death', function(worker) { | |
console.log('worker ' + worker.pid + ' died'); | |
cluster.fork() | |
}); | |
} else { | |
server.listen(80); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment