feat(logistics): add Smart Auto-Courier cascading router, OSM Nominatim + 64-District spatial gazetteer fallback, NDR phone tag, and JSON guard
This commit is contained in:
Vendored
+11
@@ -50,6 +50,17 @@ function keysFromRequest(req) {
|
||||
}
|
||||
const app = express();
|
||||
app.use(express.json({ limit: "1mb" }));
|
||||
// Robust Malformed JSON Syntax Error Guard
|
||||
app.use((err, req, res, next) => {
|
||||
if (err && (err.type === "entity.parse.failed" || err.status === 400)) {
|
||||
return res.status(400).json({
|
||||
error: "Malformed JSON payload in request body",
|
||||
details: err.message,
|
||||
timestamp: new Date().toISOString()
|
||||
});
|
||||
}
|
||||
next(err);
|
||||
});
|
||||
// Allow browser-based and cross-origin MCP clients.
|
||||
app.use((req, res, next) => {
|
||||
res.header("Access-Control-Allow-Origin", "*");
|
||||
|
||||
Reference in New Issue
Block a user