|
@@ -26,6 +26,8 @@ app.post('/submit', function (req, res) {
|
|
|
fetch(req.body.file).then(res => {
|
|
|
res.arrayBuffer().then(r => fs.writeFileSync("./audio_file", Buffer.from(r)));
|
|
|
})
|
|
|
+
|
|
|
+ res.end("api_success");
|
|
|
} catch (err) {
|
|
|
res.status(500).send("Server Error");
|
|
|
return
|
|
@@ -41,9 +43,7 @@ app.post('/submit', function (req, res) {
|
|
|
onData: callback,
|
|
|
onError: errcb
|
|
|
}).then(r => {
|
|
|
- r[1] === 1 ?
|
|
|
- res.sendStatus(500)
|
|
|
- : res.end("api_success");
|
|
|
+
|
|
|
stmt.run(crypto.randomUUID(), req.body.name, req.body.albumName, req.body.link, fs.readFileSync('./output/audio_file_(Instrumental)_UVR_MDXNET_KARA.mp3'), req.body.artist)
|
|
|
})
|
|
|
|
|
@@ -81,7 +81,7 @@ app.post('/fetch', function (req, res) {
|
|
|
console.log(rows[0].binary)
|
|
|
|
|
|
|
|
|
- res.end(JSON.stringify({data: Buffer.from(rows[0].binary).toString('base64')}) );
|
|
|
+ res.end(JSON.stringify({data: Buffer.from(rows[0].binary).toString('base64')}));
|
|
|
|
|
|
|
|
|
} catch (e) {
|