Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ Repository | Reference | Recent Version
[request][requestGHUrl] | [Documentation][requestDOCUrl] | [![NPM version][requestNPMVersionImage]][requestNPMUrl]
[sanitize-html][sanitize-htmlGHUrl] | [Documentation][sanitize-htmlDOCUrl] | [![NPM version][sanitize-htmlNPMVersionImage]][sanitize-htmlNPMUrl]
[select2][select2GHUrl] | [Documentation][select2DOCUrl] | [![NPM version][select2NPMVersionImage]][select2NPMUrl]
[toobusy-js][toobusy-jsGHUrl] | [Documentation][toobusy-jsDOCUrl] | [![NPM version][toobusy-jsNPMVersionImage]][toobusy-jsNPMUrl]
[underscore][underscoreGHUrl] | [Documentation][underscoreDOCUrl] | [![NPM version][underscoreNPMVersionImage]][underscoreNPMUrl]


Expand Down Expand Up @@ -240,11 +239,6 @@ Repository | Reference | Recent Version | Referenced
[sanitize-htmlNPMUrl]: https://npmjs.org/package/sanitize-html
[sanitize-htmlNPMVersionImage]: https://img.shields.io/npm/v/sanitize-html.svg?style=flat

[toobusy-jsGHUrl]: https://github.com/STRML/node-toobusy
[toobusy-jsDOCUrl]: https://github.com/STRML/node-toobusy/blob/master/README.md
[toobusy-jsNPMUrl]: https://npmjs.org/package/toobusy-js
[toobusy-jsNPMVersionImage]: https://img.shields.io/npm/v/toobusy-js.svg?style=flat

[underscoreGHUrl]: https://github.com/jashkenas/underscore
[underscoreDOCUrl]: http://underscorejs.org/
[underscoreNPMUrl]: https://npmjs.org/package/underscore
Expand Down
15 changes: 0 additions & 15 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var toobusy = require('toobusy-js');
var express = require('express');
var minify = require('express-minify');
var MongoStore = require('connect-mongo')(express);
Expand Down Expand Up @@ -30,20 +29,6 @@ db.once('open', function () {

var sessionStore = new MongoStore({ mongoose_connection: db });

// See https://hacks.mozilla.org/2013/01/building-a-node-js-server-that-wont-melt-a-node-js-holiday-season-part-5/
app.use(function (aReq, aRes, aNext) {
// check if we're toobusy
toobusy.maxLag(100);
if (toobusy()) {
statusCodePage(aReq, aRes, aNext, {
statusCode: 503,
statusMessage: 'We\'re busy right now. Try again later.',
});
} else {
aNext();
}
});

// Force HTTPS
if (app.get('port') === 443) {
app.use(function (aReq, aRes, aNext) {
Expand Down