relay_added
This commit is contained in:
11
server.js
11
server.js
@ -2,9 +2,17 @@ require('dotenv').config()
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
|
||||
var fs = require('fs');
|
||||
var obj = JSON.parse(fs.readFileSync('./html/vars.json', 'utf8'));
|
||||
|
||||
const path = require('path')
|
||||
const html = path.join(__dirname, '/html');
|
||||
app.use(express.static(html))
|
||||
console.log(obj["path"]);
|
||||
app.use(obj["path"],express.static(html))
|
||||
app.set('etag', false);
|
||||
app.get(obj["path"], (req, res) => {
|
||||
res.sendFile(__dirname + '/html/index.html');
|
||||
})
|
||||
|
||||
const port = process.argv[2] || 8090;
|
||||
const http = require("http").Server(app);
|
||||
@ -12,6 +20,7 @@ const http = require("http").Server(app);
|
||||
const maxHttpBufferSizeInMb = parseInt(process.env.MAX_HTTP_BUFFER_SIZE_MB || '1');
|
||||
const io = require("socket.io")(http, {
|
||||
maxHttpBufferSize: maxHttpBufferSizeInMb * 1024 * 1024,
|
||||
path: obj["path"]+"socket.io"
|
||||
});
|
||||
let messageCache = [];
|
||||
// default cache size to zero. override in environment
|
||||
|
||||
Reference in New Issue
Block a user