Implement Discord CnC Server into Emmelia

This commit is contained in:
Logan Cusano
2023-02-24 21:27:55 -05:00
parent 0ee5c4293f
commit 24b16d87ea
19 changed files with 926 additions and 135 deletions

31
routes/nodes.js Normal file
View File

@@ -0,0 +1,31 @@
const express = require('express');
const router = express.Router();
const nodesController = require('../controllers/nodesController');
/* GET nodes the server knows */
router.get('/', nodesController.listAllNodes);
// TODO Need to authenticate this request
/* POST a new node to the server
*
* Will create a new DB entry for the node for the server to reference later
* Req. body: {
* "serverInfo": {"ip": "x.x.x.x", port: 0000}
* }
*
* Will return a token for the client to reference when the bot is making requests
* Res. body {
* "serverToken": ""
* }
*/
router.post('/newNode', nodesController.newNode);
// TODO Need to authenticate this request
/* GET the information the server has on a particular node */
router.get('/nodeInfo', nodesController.getNodeInfo);
// TODO Need to authenticate this request
// Client checkin with the server to update information
router.post('/nodeCheckIn', nodesController.nodeCheckIn);
module.exports = router;