summaryrefslogtreecommitdiff
path: root/backend/src/routes/router.ts
diff options
context:
space:
mode:
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;