From 1d8d947ec51aac581a67e74dee59510a20758896 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 17:42:41 +0000 Subject: [PATCH] Update server.js to enhance GeoJSON parameter handling and logging --- src/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.js b/src/server.js index fab3979..e77fc48 100644 --- a/src/server.js +++ b/src/server.js @@ -1,6 +1,6 @@ const express = require('express'), http = require('http'), - osmsm = require('./lib.js'); + { main: osmsm, isValidGeojson } = require('./lib.js'); const fs = require('fs'); const app = express(); @@ -67,7 +67,7 @@ const handler = (res, params, reqDetails) => { try { const parsedGeojson = JSON.parse(params.geojson); // Validate the parsed GeoJSON object before proceeding - if (!osmsm.isValidGeojson(parsedGeojson)) { + if (!isValidGeojson(parsedGeojson)) { throw new Error('Parsed GeoJSON object is not valid.'); } logStream.write(`Parsed GeoJSON parameter: ${JSON.stringify(parsedGeojson)}\n`);