Update server.js

This commit is contained in:
Cohee 2023-12-02 15:32:09 +02:00 committed by GitHub
parent 641cd614c8
commit a1754c7192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,6 @@ const compression = require('compression');
const cookieParser = require('cookie-parser'); const cookieParser = require('cookie-parser');
const multer = require("multer"); const multer = require("multer");
const responseTime = require('response-time'); const responseTime = require('response-time');
const bodyParser = require('body-parser');
// net related library imports // net related library imports
const net = require("net"); const net = require("net");
@ -107,7 +106,6 @@ process.chdir(directory);
const app = express(); const app = express();
app.use(compression()); app.use(compression());
app.use(responseTime()); app.use(responseTime());
app.use(bodyParser.json());
// impoort from statsHelpers.js // impoort from statsHelpers.js
@ -308,6 +306,8 @@ app.use(function (req, res, next) {
}); });
if (getConfigValue('enableCorsProxy', false) === true || cliArguments.corsProxy === true) { if (getConfigValue('enableCorsProxy', false) === true || cliArguments.corsProxy === true) {
const bodyParser = require('body-parser');
app.use(bodyParser.json());
console.log('Enabling CORS proxy'); console.log('Enabling CORS proxy');
app.use('/proxy/:url(*)', async (req, res) => { app.use('/proxy/:url(*)', async (req, res) => {