switched to new way :)
This commit is contained in:
parent
b03a2a25f1
commit
f22d182c8f
30 changed files with 0 additions and 0 deletions
23
src-old/server/routes/control.ts
Normal file
23
src-old/server/routes/control.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Router } from 'express';
|
||||
import type { Bot } from '../../bot/Bot.js';
|
||||
|
||||
export function controlRoutes(bot: Bot): Router {
|
||||
const router = Router();
|
||||
|
||||
router.post('/pause', (_req, res) => {
|
||||
bot.pause();
|
||||
res.json({ ok: true });
|
||||
});
|
||||
|
||||
router.post('/resume', (_req, res) => {
|
||||
bot.resume();
|
||||
res.json({ ok: true });
|
||||
});
|
||||
|
||||
router.post('/settings', (req, res) => {
|
||||
bot.updateSettings(req.body);
|
||||
res.json({ ok: true });
|
||||
});
|
||||
|
||||
return router;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue