From 7d51bc002bd72b8c7d25e8e1ebcfc3ca0b41183e Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 12 Oct 2023 20:58:11 +0100 Subject: [PATCH] Remove route declarations for old API version and update names of current route files Signed-off-by: Fred Boniface --- app.js | 22 +++++------------- src/routes/find.routes.ts | 23 ------------------- src/routes/issue.routes.ts | 7 ------ src/routes/kube.routes.ts | 9 -------- src/routes/ldb.routes.ts | 19 --------------- src/routes/ldbs.routes.ts | 22 ------------------ src/routes/list.routes.ts | 20 ---------------- .../{live2.routes.ts => live.routes.ts} | 0 src/routes/pis.routes.ts | 8 +++---- src/routes/pis2.routes.ts | 9 -------- src/routes/{ref2.routes.ts => ref.routes.ts} | 0 src/routes/registration.routes.ts | 8 ------- src/routes/stats.routes.ts | 7 ------ ...metable2.routes.ts => timetable.routes.ts} | 0 .../{user2.routes.ts => user.routes.ts} | 0 15 files changed, 10 insertions(+), 144 deletions(-) delete mode 100644 src/routes/find.routes.ts delete mode 100644 src/routes/issue.routes.ts delete mode 100644 src/routes/kube.routes.ts delete mode 100644 src/routes/ldb.routes.ts delete mode 100644 src/routes/ldbs.routes.ts delete mode 100644 src/routes/list.routes.ts rename src/routes/{live2.routes.ts => live.routes.ts} (100%) delete mode 100644 src/routes/pis2.routes.ts rename src/routes/{ref2.routes.ts => ref.routes.ts} (100%) delete mode 100644 src/routes/registration.routes.ts delete mode 100644 src/routes/stats.routes.ts rename src/routes/{timetable2.routes.ts => timetable.routes.ts} (100%) rename src/routes/{user2.routes.ts => user.routes.ts} (100%) diff --git a/app.js b/app.js index 4925e7a..fc95609 100644 --- a/app.js +++ b/app.js @@ -19,23 +19,13 @@ const cors = require("cors"); const authenticate = require("./src/middlewares/auth.middlewares"); // Internal Requires -const version = require("./src/configs/version.configs"); /* -{}{}{} REMOVE THESE FILES - THEY ARE NO LONGER REQUIRED - {}{}{} -const listRtr = require("./src/routes/list.routes"); -const ldbRtr = require("./src/routes/ldb.routes"); -const ldbsRtr = require("./src/routes/ldbs.routes"); -const kubeRtr = require("./src/routes/kube.routes"); -const findRtr = require("./src/routes/find.routes"); -const issueRtr = require("./src/routes/issue.routes"); -const statRtr = require("./src/routes/stats.routes"); -const regRtr = require("./src/routes/registration.routes"); -const pisRtr = require("./src/routes/pis.routes");*/ +const version = require("./src/configs/version.configs"); const trainRtr = require("./src/routes/train.routes"); -const pis2Rtr = require("./src/routes/pis2.routes"); // API Version 2 Routes -const ref2Rtr = require("./src/routes/ref2.routes"); // API Version 2 Routes -const live2Rtr = require("./src/routes/live2.routes"); // API Version 2 Routes -const tt2Rtr = require("./src/routes/timetable2.routes"); // API Version 2 -const user2Rtr = require("./src/routes/user2.routes"); // API Version 2 Routes +const pis2Rtr = require("./src/routes/pis.routes"); // API Version 2 Routes +const ref2Rtr = require("./src/routes/ref.routes"); // API Version 2 Routes +const live2Rtr = require("./src/routes/live.routes"); // API Version 2 Routes +const tt2Rtr = require("./src/routes/timetable.routes"); // API Version 2 +const user2Rtr = require("./src/routes/user.routes"); // API Version 2 Routes const miscRtr = require("./src/routes/misc.routes"); // Non-Public API Routes // Set Server Configurations diff --git a/src/routes/find.routes.ts b/src/routes/find.routes.ts deleted file mode 100644 index e8e572f..0000000 --- a/src/routes/find.routes.ts +++ /dev/null @@ -1,23 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const findController = require("../controllers/find.controllers"); - -/* GET programming languages. */ -//router.get('/', programmingLanguagesController.get); - -/* POST programming language */ -//router.post('/', programmingLanguagesController.create); - -/* PUT programming language */ -//router.put('/:id', programmingLanguagesController.update); - -/* DELETE programming language */ -//router.delete('/:id', programmingLanguagesController.remove); - -router.get("/name/:id", findController.findName); -router.get("/crs/:id", findController.findCrs); -router.get("/nlc/:id", findController.findNlc); -router.get("/tiploc/:id", findController.findTiploc); -router.get("/stanox/:id", findController.findStanox); - -module.exports = router; diff --git a/src/routes/issue.routes.ts b/src/routes/issue.routes.ts deleted file mode 100644 index cc5023e..0000000 --- a/src/routes/issue.routes.ts +++ /dev/null @@ -1,7 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const issueController = require("../controllers/issue.controllers"); - -router.post("/", issueController.post); - -module.exports = router; diff --git a/src/routes/kube.routes.ts b/src/routes/kube.routes.ts deleted file mode 100644 index 1fd2747..0000000 --- a/src/routes/kube.routes.ts +++ /dev/null @@ -1,9 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const kubeController = require("../controllers/kube.controllers"); - -router.get("/alive", kubeController.getAlive); -router.get("/ready", kubeController.getReady); -router.get("/time", kubeController.getTime); - -module.exports = router; diff --git a/src/routes/ldb.routes.ts b/src/routes/ldb.routes.ts deleted file mode 100644 index 8d4587e..0000000 --- a/src/routes/ldb.routes.ts +++ /dev/null @@ -1,19 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const ldbController = require("../controllers/ldb.controllers"); - -/* GET programming languages. */ -//router.get('/', programmingLanguagesController.get); - -/* POST programming language */ -//router.post('/', programmingLanguagesController.create); - -/* PUT programming language */ -//router.put('/:id', programmingLanguagesController.update); - -/* DELETE programming language */ -//router.delete('/:id', programmingLanguagesController.remove); - -router.get("/:id", ldbController.get); - -module.exports = router; diff --git a/src/routes/ldbs.routes.ts b/src/routes/ldbs.routes.ts deleted file mode 100644 index dd24ca3..0000000 --- a/src/routes/ldbs.routes.ts +++ /dev/null @@ -1,22 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const ldbsController = require("../controllers/ldbs.controllers"); - -/* GET programming languages. */ -//router.get('/', programmingLanguagesController.get); - -/* POST programming language */ -//router.post('/', programmingLanguagesController.create); - -/* PUT programming language */ -//router.put('/:id', programmingLanguagesController.update); - -/* DELETE programming language */ -//router.delete('/:id', programmingLanguagesController.remove); - -router.get("/arrdep/:id", ldbsController.get); -router.get("/reasonCode", ldbsController.getReasonCodeList); -router.get("/reasonCode/:code", ldbsController.getReasonCode); -router.get("/service/rid/:rid", ldbsController.getTrainByRID); - -module.exports = router; diff --git a/src/routes/list.routes.ts b/src/routes/list.routes.ts deleted file mode 100644 index ba48211..0000000 --- a/src/routes/list.routes.ts +++ /dev/null @@ -1,20 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const listController = require("../controllers/list.controllers"); - -/* GET programming languages. */ -//router.get('/', programmingLanguagesController.get); - -/* POST programming language */ -//router.post('/', programmingLanguagesController.create); - -/* PUT programming language */ -//router.put('/:id', programmingLanguagesController.update); - -/* DELETE programming language */ -//router.delete('/:id', programmingLanguagesController.remove); - -router.get("/stations", listController.getStations); -router.get("/corpus", listController.getCorpus); - -module.exports = router; diff --git a/src/routes/live2.routes.ts b/src/routes/live.routes.ts similarity index 100% rename from src/routes/live2.routes.ts rename to src/routes/live.routes.ts diff --git a/src/routes/pis.routes.ts b/src/routes/pis.routes.ts index d0f72c2..6a9aee8 100644 --- a/src/routes/pis.routes.ts +++ b/src/routes/pis.routes.ts @@ -1,9 +1,9 @@ const express = require("express"); const router = express.Router(); -const pisController = require("../controllers/pis.controllers"); +const pisCtr = require("../controllers/pis.controllers"); -router.get("/origdest/:start/:end", pisController.byOrigDest); -router.get("/code/:code", pisController.byCode); -router.get("/code/random", pisController.random); +// PIS +router.get("/byCode/:code", pisCtr.byCode); +router.get("/byStartEnd/:startCrs/:endCrs", pisCtr.byStartEndCRS); module.exports = router; diff --git a/src/routes/pis2.routes.ts b/src/routes/pis2.routes.ts deleted file mode 100644 index 6a9aee8..0000000 --- a/src/routes/pis2.routes.ts +++ /dev/null @@ -1,9 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const pisCtr = require("../controllers/pis.controllers"); - -// PIS -router.get("/byCode/:code", pisCtr.byCode); -router.get("/byStartEnd/:startCrs/:endCrs", pisCtr.byStartEndCRS); - -module.exports = router; diff --git a/src/routes/ref2.routes.ts b/src/routes/ref.routes.ts similarity index 100% rename from src/routes/ref2.routes.ts rename to src/routes/ref.routes.ts diff --git a/src/routes/registration.routes.ts b/src/routes/registration.routes.ts deleted file mode 100644 index ac0d4bc..0000000 --- a/src/routes/registration.routes.ts +++ /dev/null @@ -1,8 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const regController = require("../controllers/registration.controllers"); - -router.post("/request", regController.request); -router.post("/register", regController.register); - -module.exports = router; diff --git a/src/routes/stats.routes.ts b/src/routes/stats.routes.ts deleted file mode 100644 index 013e5f1..0000000 --- a/src/routes/stats.routes.ts +++ /dev/null @@ -1,7 +0,0 @@ -const express = require("express"); -const router = express.Router(); -const statsController = require("../controllers/stats.controllers"); - -router.get("/", statsController.get); - -module.exports = router; diff --git a/src/routes/timetable2.routes.ts b/src/routes/timetable.routes.ts similarity index 100% rename from src/routes/timetable2.routes.ts rename to src/routes/timetable.routes.ts diff --git a/src/routes/user2.routes.ts b/src/routes/user.routes.ts similarity index 100% rename from src/routes/user2.routes.ts rename to src/routes/user.routes.ts