- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
express_static = express.static(static_files.file_path)
app.use('/files', (req, res, next) ->
if Math.random() > app.failureProbability
express_static.handle(req, res, next)
else
# server failure or timeout
if Math.random() < 0.5
console.log('\x1B[31mRandom failure\x1B[0m')
res.send(500, 'Fuck you')
else
console.log('\x1B[31mRandom timeout\x1B[0m')
)
movaxbx 22.12.2014 14:29 # 0
makc3d 22.12.2014 15:14 # 0
тут, кстати, ещё и бага была
.handle лишний )
guest 23.12.2014 04:39 # +2
heyzea1 23.12.2014 14:28 # 0