Added next play time to html page

This commit is contained in:
Myx
2023-10-14 20:27:09 +02:00
parent 507edc1dea
commit c51bc4bb32
5 changed files with 91 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
import { nextPlayBackTime } from './../bot';
import express from 'express';
import multer, { diskStorage } from 'multer';
import path from 'path';
@@ -11,6 +12,7 @@ const storage = diskStorage({
}
});
const upload = multer({
storage: storage,
limits: { fileSize: 1 * 1024 * 1024 },
@@ -41,6 +43,10 @@ app.get('/sounds', (_req, res) => {
});
});
app.get('/nextplaybacktime', (_req, res) => {
res.send(nextPlayBackTime);
});
app.delete('/sounds/:filename', (req, res) => {
const fs = require('fs');
const directoryPath = path.join(__dirname, '../sounds');