Files
DRB-CnC/Client/routes/client.js
Logan Cusano ba927bae8c Implement install and update system for the bot
- LINUX OR WINDOW WSL ONLY
2023-05-27 17:00:57 -04:00

55 lines
1.9 KiB
JavaScript

// Modules
const express = require('express');
const router = express.Router();
// Controllers
const { requestCheckIn, getPresets, updatePreset, addNewPreset, removePreset, updateClient } = require("../controllers/clientController");
/** GET Request a check in from the client
* Queue the client to check in with the server
*
* The status of the checkin request: 200 = Queued
*/
router.get('/requestCheckIn', requestCheckIn);
/** GET Object of all known presets
* Query the client to get all the known presets
*/
router.get('/presets', getPresets);
/** POST Update to preset
*
* @param req The request sent from the master
* @param {string} req.body.systemName The name of the system to be updated
* @param {Array} req.body.frequencies The frequencies array for the channel or channels to be listened to
* @param {string} req.body.mode The listening mode for the SDR
* @param {string} req.body.trunkFile If the listening mode is digital this can be set to identify the communications
*/
router.post('/updatePreset', updatePreset);
/** POST Add new preset
* Join the channel specified listening to the specified freq/mode
*
* @param req The request sent from the master
* @param {string} req.body.systemName The name of the system to be updated
* @param {Array} req.body.frequencies The frequencies array for the channel or channels to be listened to
* @param {string} req.body.mode The listening mode for the SDR
* @param {string} req.body.trunkFile If the listening mode is digital this can be set to identify the communications
*/
router.post('/addPreset', addNewPreset);
/** POST Remove a preset
*
* @param req The request sent from the master
* @param {string} req.body.systemName The name of the system to be updated
*/
router.post('/removePreset', removePreset);
/** POST Update the bot
*
* @param req The request sent from the master
*/
router.post('/updateClient', updateClient);
module.exports = router;