TimetableAPI-Upgrade #64

Merged
fred.boniface merged 36 commits from TimetableAPI-Upgrade into main 2024-02-11 15:53:17 +00:00
15 changed files with 10 additions and 144 deletions
Showing only changes of commit 7d51bc002b - Show all commits

22
app.js
View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;