From 84791ea93a6a229b0d75ed709d17a5a6366e67ae Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 9 Nov 2023 20:42:19 +0000 Subject: [PATCH] Add route for testing https://git.fjla.uk/OwlBoard/backend/issues/47 Signed-off-by: Fred Boniface --- src/controllers/pis.controllers.js | 6 ++++++ src/routes/pis.routes.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/controllers/pis.controllers.js b/src/controllers/pis.controllers.js index bdc1e65..144e58c 100644 --- a/src/controllers/pis.controllers.js +++ b/src/controllers/pis.controllers.js @@ -47,8 +47,14 @@ async function random(req, res, next) { } } +async function testingTiplocArray(req, res, next) { + let array = JSON.parse(req.params.array) + return pis.testingTiplocArray(array) +} + module.exports = { byStartEndCRS, byCode, random, + testingTiplocArray }; diff --git a/src/routes/pis.routes.ts b/src/routes/pis.routes.ts index 6a9aee8..6e2fc63 100644 --- a/src/routes/pis.routes.ts +++ b/src/routes/pis.routes.ts @@ -5,5 +5,6 @@ const pisCtr = require("../controllers/pis.controllers"); // PIS router.get("/byCode/:code", pisCtr.byCode); router.get("/byStartEnd/:startCrs/:endCrs", pisCtr.byStartEndCRS); +router.get("/test/bytiplocarray/:array", pisCtr.testingTiplocArray); module.exports = router;