Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Update to express 4.x (in time for the drama)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoodman committed Jul 31, 2014
1 parent f94d87c commit 00945f2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 280 deletions.
238 changes: 0 additions & 238 deletions index.coffee

This file was deleted.

27 changes: 16 additions & 11 deletions package.json
Expand Up @@ -18,23 +18,28 @@
"description": "The code powering the public facing component of http://plnkr.co",
"main": "server.js",
"dependencies": {
"JSONStream": "0.4.x",
"authom": "https://github.com/ggoodman/authom/tarball/patch-1",
"body-parser": "^1.5.2",
"coffee-script": "~1.6.x",
"compression": "^1.0.9",
"connect-assets": "https://github.com/filearts/connect-assets/tarball/master",
"cookie-parser": "^1.3.2",
"errorhandler": "^1.1.1",
"event-stream": "3.0.x",
"express": "^4.7.2",
"express-state": "^1.2.0",
"forever-monitor": "^1.2.3",
"hbs": "~2.4.0",
"jade": "~0.27.6",
"less": "~1.3.3",
"mime": "~1.2.7",
"authom": "https://github.com/ggoodman/authom/tarball/patch-1",
"nconf": "~0.6.4",
"express": "~3.0.0",
"less": "~1.3.3",
"connect-assets": "https://github.com/filearts/connect-assets/tarball/master",
"prerender-node": "~1.0.0",
"request": "~2.11.4",
"lactate": "0.13.x",
"xmlbuilder": "0.4.x",
"JSONStream": "0.4.x",
"event-stream": "3.0.x",
"express-state": "~1.0.0",
"secure-filters": "~1.0.4",
"hbs": "~2.4.0",
"prerender-node": "~1.0.0"
"serve-static": "^1.4.3",
"xmlbuilder": "0.4.x"
},
"devDependencies": {
"rimraf": "~2.2.2",
Expand Down
38 changes: 7 additions & 31 deletions server.js
@@ -1,35 +1,11 @@
require("coffee-script");
var forever = require('forever-monitor');

//process.env.NODE_ENV = "production";

var nconf = require("nconf")
, http = require("http")
, server = require("./index")
, domain = require("domain")
, serverDomain = domain.create();


serverDomain.run(function(){
http.createServer(function(req, res){
var reqd = domain.create();
reqd.add(req);
reqd.add(res);

// On error dispose of the domain
reqd.on('error', function (error) {
console.error('[ERR]', error.code, error.message, req.url);
reqd.dispose();
});
var child = new (forever.Monitor)('index.js', {
max: 10,
});

// Pass the request to express
server(req, res);

}).listen(nconf.get("PORT"), function(){
console.log("[OK] Server started");
});

child.on('exit', function () {
console.log('[ERR] App killed after 10 fails.');
});

serverDomain.on("error", function (error) {
console.error('[ERR]', "Server level error", error.code, error.message, error);
})
child.start();

0 comments on commit 00945f2

Please sign in to comment.