Commit 6c6ed32d8aba4e50f421bb0a650b0a706da35aab
1 parent
ae643ea7
Exists in
master
Adiciona timeout
Showing
2 changed files
with
9 additions
and
4 deletions
Show diff stats
helpers/properties.js
server.js
| ... | ... | @@ -7,6 +7,7 @@ var endpoint_sinal = require('./endpoints/sinal'); |
| 7 | 7 | /* Environment */ |
| 8 | 8 | var fs = require('fs'); |
| 9 | 9 | var https = require('https'); |
| 10 | +var http = require('http'); | |
| 10 | 11 | var path = require('path'); |
| 11 | 12 | var express = require('express'); |
| 12 | 13 | var bodyParser = require('body-parser'); |
| ... | ... | @@ -85,9 +86,11 @@ function createHttpsServer() { |
| 85 | 86 | } |
| 86 | 87 | |
| 87 | 88 | function createHttpServer() { |
| 88 | - app.listen(properties.PORT, properties.HOST, function() { | |
| 89 | - console.log('Server running on http://' + properties.HOST + ':' + properties.PORT); | |
| 90 | - }); | |
| 89 | + var httpServer = http.createServer(app); | |
| 90 | + httpServer.setTimeout(properties.CONNECTION_TIMEOUT); | |
| 91 | + httpServer.listen(properties.PORT, properties.HOST, function() { | |
| 92 | + console.log('Server running on http://' + properties.HOST + ':' + properties.PORT); | |
| 93 | + }); | |
| 91 | 94 | } |
| 92 | 95 | |
| 93 | 96 | if (properties.SSL) { | ... | ... |