Skip to content

Commit

Permalink
add keepalive
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Sep 19, 2023
1 parent 9e53e82 commit 994e30e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const app = express();
const cors = require('cors')
const Gamedig = require('gamedig');
const mcache = require('memory-cache');
const port = process.env.PORT || 3035;

app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
Expand Down Expand Up @@ -74,4 +75,7 @@ app.get('/game/:gamename/:host/:port', cache(120), (req, res, next) => {

var httpsServer = http.createServer({}, app);

httpsServer.listen(3035);
const server = httpsServer.listen(port, () => console.log(`App listening on port ${port}!`));

server.keepAliveTimeout = 120 * 1000;
server.headersTimeout = 120 * 1000;

0 comments on commit 994e30e

Please sign in to comment.