Major update
- Working client server interactions - Can create radio config - Needs radio testing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var express = require('express');
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const botController = require("../controllers/botController");
|
||||
var router = express.Router();
|
||||
|
||||
/** GET bot status
|
||||
* Check to see if the bot is online and if so, if it is currently connected to anything
|
||||
@@ -27,11 +27,4 @@ router.post('/join', botController.joinServer);
|
||||
*/
|
||||
router.post('/leave', botController.leaveServer);
|
||||
|
||||
/** POST change bot preset
|
||||
* This will change the bot to the preset specified (if different from what is currently playing)
|
||||
*
|
||||
* The status of the bot: 200 = no change, 202 = changed successfully, 500 + JSON = encountered error
|
||||
* @returns status
|
||||
*/
|
||||
|
||||
module.exports = router;
|
||||
|
||||
30
Client/routes/radio.js
Normal file
30
Client/routes/radio.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// Controllers
|
||||
const radioController = require("../controllers/radioController");
|
||||
// Debug
|
||||
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
||||
const log = new DebugBuilder("client", "clientController");
|
||||
// Modules
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
/**
|
||||
* POST Open a new radio session
|
||||
* This will open OP25 to the current specified radio settings
|
||||
*/
|
||||
router.post('/start', radioController.openRadioSession);
|
||||
|
||||
/**
|
||||
* POST Close the current radio session
|
||||
*/
|
||||
router.post('/stop', radioController.closeRadioSession);
|
||||
|
||||
/** POST change current radio preset
|
||||
* This will change the bot to the preset specified (if different from what is currently playing)
|
||||
* @param req The request sent from the master
|
||||
* @param {string} req.body.presetName The name of the system to be updated
|
||||
* The status of the bot: 200 = no change, 202 = changed successfully, 500 + JSON = encountered error
|
||||
* @returns status
|
||||
*/
|
||||
router.post('/changeConfig', radioController.changeCurrentConfig);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user