Skip to content

Commit 5edde8f

Browse files
author
llaske
committed
Add a feature to slow the server in debug mode
1 parent 637a505 commit 5edde8f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

config/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ var express = require('express'),
88
flash = require('express-flash'),
99
expressValidator = require('express-validator'),
1010
cors = require('cors');
11+
var artificialDelay = 0;
1112

1213
// configure app settings
1314
module.exports = function(app, ini) {
1415

16+
// add an artificial delay for debug
17+
if (artificialDelay) {
18+
app.use(function(req,res,next) {
19+
setTimeout(next, artificialDelay)
20+
});
21+
}
22+
1523
// must use cookieParser before express Session
1624
app.use(cookieParser());
1725
app.use(expressSession({

0 commit comments

Comments
 (0)