diff --git a/index.js b/index.js index f45bdb6..766a232 100755 --- a/index.js +++ b/index.js @@ -187,3 +187,27 @@ app.post('/upload', function (req, res) { res.redirect('/'); }); + +app.post("/delete", async (req, res) => { + let video = req.query.video; + await fs.rm(video); + res.json({ status: 'ok' }); +}); + +app.get("/selectedvideo", (req, res) => { + if (fs.existsSync('/selectedvideo')) { + res.text(fs.readFileSync('/selectedvideo').toString()); + } + else { + res.json(""); + } +}); + +app.get("/overlayvideo", (req, res) => { + if (fs.existsSync('/overlayvideo')) { + res.text(fs.readFileSync('/overlayvideo').toString()); + } + else { + res.json(""); + } +}); diff --git a/public/index.html b/public/index.html index dd08011..259e1e4 100755 --- a/public/index.html +++ b/public/index.html @@ -27,34 +27,50 @@ encType="multipart/form-data"> - + +