Skip to content

Commit

Permalink
Update server.js to enhance GeoJSON parameter handling and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed May 18, 2024
1 parent dbb13f2 commit 1d8d947
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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`);
Expand Down

0 comments on commit 1d8d947

Please sign in to comment.