Skip to content

Commit

Permalink
Changed response to be more dynamic, depending on settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Coow committed Sep 22, 2023
1 parent 76df225 commit 55f38a3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/extension/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ module.exports = function (nodecg: NodeCG.ServerAPI) {
const caster1 = nodecg.Replicant<string>('caster1');
const caster2 = nodecg.Replicant<string>('caster2');
const observer = nodecg.Replicant<string>('observer');
const showobserver = nodecg.Replicant<boolean>('showobserver');

const router = nodecg.Router();

router.get('/casters', (req, res) => {
res.send(`Todays casters: Left: ${caster1.value} & Right: ${caster2.value}! Observer: ${observer.value}`);
let response = `Todays casters: Left: ${caster1.value} & Right: ${caster2.value}!`
{showobserver.value ? response += `Observer: ${observer.value}` : ''}
res.send(response);
});


router.get('/observer', (req, res) => {
res.send(`Todays Observer: ${observer.value}`);
let response = ''
{showobserver.value ? response = `Todays Observer: ${observer.value}` : response = 'No dedicated observer today :('}

res.send(response);
});

nodecg.mount('/caster', router);
};
};

0 comments on commit 55f38a3

Please sign in to comment.