From b8c1535cf85b10bbffcde1a708b1df4a5052ee7e Mon Sep 17 00:00:00 2001 From: fleetside72 Date: Wed, 30 Jan 2019 20:25:03 -0500 Subject: [PATCH] add route for ad-hoc regex evaluations: --- server.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server.js b/server.js index 01cad87..41d550c 100644 --- a/server.js +++ b/server.js @@ -81,6 +81,13 @@ server.post("/regex", bodyParser.json(), function (inReq, inRes) Postgres.FirstRow(sql, [JSON.stringify(inReq.body)], inRes); }); +//takes an ad-hoc regex definition in curly braces +server.get("/regex_test", bodyParser.json(), function (inReq, inRes) +{ + var sql = "SELECT x.message FROM tps.test_regex_recs($1::jsonb) as x(message)"; + Postgres.FirstRow(sql, [JSON.stringify(inReq.body)], inRes); +}); + //------------------------------------------------------------mappings--------------------------------------------------------------------------------------------------------------------------------- //list unmapped items flagged to be mapped ?srce=