summaryrefslogtreecommitdiff
path: root/backend/src/routes/router.ts
diff options
context:
space:
mode:
authorArne Rief <riearn@proton.me>2025-12-22 21:20:39 +0100
committerArne Rief <riearn@proton.me>2025-12-22 21:20:39 +0100
commite836e7dd4ed5e9fa60e949d159100040b22a8f48 (patch)
treea11954c06e55e8ef53fcb634fa5954dfcb42ffc3 /backend/src/routes/router.ts
parentd1b64ddd78d8b8dc3eca76038a75071ab2a575d9 (diff)
Movement simulator for all and single robot, project v1 ready
Diffstat (limited to 'backend/src/routes/router.ts')
-rw-r--r--backend/src/routes/router.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/src/routes/router.ts b/backend/src/routes/router.ts
index b526a9b..72fd885 100644
--- a/backend/src/routes/router.ts
+++ b/backend/src/routes/router.ts
@@ -3,6 +3,10 @@ import createRobot from "../controllers/createRobot.js";
import generateAdmin from "../controllers/generateAdmin.js";
import getRobots from "../controllers/getRobots.js";
import loginUser from "../controllers/loginUser.js";
+import moveAllRobots from "../controllers/moveAllRobots.js";
+import moveRobot from "../controllers/moveRobot.js";
+import stopAllRobots from "../controllers/stopAllRobots.js";
+import stopRobot from "../controllers/stopRobot.js";
import authenticateUser from "../middleware/authCheck.js";
const router = Router();
@@ -15,6 +19,12 @@ router.post("/auth/login", loginUser);
router.get("/robots", authenticateUser, getRobots);
// Create a new robot; protected route
router.post("/robots", authenticateUser, createRobot);
+// All robots move or stop; protected routes
+router.post("/robots/move", authenticateUser, moveAllRobots);
+router.post("/robots/stop", authenticateUser, stopAllRobots);
+// Single robot move or stop; protected routes
+router.post("/robots/:id/move", authenticateUser, moveRobot);
+router.post("/robots/:id/stop", authenticateUser, stopRobot);
export default router;