From 5a67191f8ccf05eeaffa464d5e6159965a2d5f18 Mon Sep 17 00:00:00 2001 From: Gautam Anand Date: Wed, 16 Oct 2024 07:29:05 -0500 Subject: [PATCH] Bug fix with map --- components/maps/mapView.js | 6 +++--- server.js | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/maps/mapView.js b/components/maps/mapView.js index d65c9217..61e675d2 100644 --- a/components/maps/mapView.js +++ b/components/maps/mapView.js @@ -62,7 +62,7 @@ export default function MapView({ inLegacy, gameOptions, setGameOptions, singlep } useEffect(() => { refreshHome(); - }, [session?.token?.secret, text]); + }, [session?.token?.secret]); const debounce = (func, delay) => { let timer; @@ -106,7 +106,7 @@ export default function MapView({ inLegacy, gameOptions, setGameOptions, singlep return; } - fetch("/api/map/action", { + fetch(window.cConfig?.apiUrl+"/api/map/action", { method: "POST", headers: { "Content-Type": "application/json", @@ -153,7 +153,7 @@ export default function MapView({ inLegacy, gameOptions, setGameOptions, singlep setHeartingMap(map.id); - fetch("/api/map/heartMap", { + fetch(window.cConfig?.apiUrl+"/api/map/heartMap", { method: "POST", headers: { "Content-Type": "application/json", diff --git a/server.js b/server.js index c47e1209..ce2a067b 100644 --- a/server.js +++ b/server.js @@ -54,9 +54,8 @@ var app = express(); // disable cors import cors from 'cors'; app.use(cors()); -app.use(bodyParser.json()); - -app.use(express.json()); +app.use(bodyParser.json({limit: '5mb'})); +app.use(bodyParser.urlencoded({limit: '5mb', extended: true, parameterLimit:50000})); // Setup your /api routes const apiFolder = path.join(__dirname, 'api');