axcwg 6 months ago
parent
commit
a719394045
1 changed files with 8 additions and 7 deletions
  1. 8 7
      main.js

+ 8 - 7
main.js

@@ -17,6 +17,7 @@ app_serve.use(bodyParser.json({"limit": "200mb"}));
 app_serve.use(express.json());
 
 
+
 app.post('/submit', function (req, res) {
     let uuid = crypto.randomUUID()
     db.connect(function (err) {
@@ -60,7 +61,7 @@ app.post('/submit', function (req, res) {
 
         db.execute(("INSERT INTO instrunet_entry (uuid, song_name, album_name, link_to, databinary, artist,kind) VALUES (?,?,?,?,?,?,?)"), [crypto.randomUUID(), req.body.name, req.body.albumName, req.body.link, fs.readFileSync('./output/audio_file_(Instrumental)_UVR_MDXNET_KARA.mp3'), req.body.artist, req.body.kind])
         db.unprepare()
-        fs.rmdir(uuid, {
+        fs.rm(uuid, {
             recursive: true,
         }, (err) => {
             console.log(err);
@@ -131,11 +132,11 @@ app_serve.get('/:uuid', function (req, res) {
                 WHERE uuid = '${req.params.uuid}'`, Provider)
     db.unprepare()
 })
-//
-// https.createServer({
-//     key: fs.readFileSync('andyxie.cn.key'),
-//     cert: fs.readFileSync('andyxie.cn.pem')
-// }, app).listen(8080)
 
-app.listen(8080)
+https.createServer({
+    key: fs.readFileSync('andyxie.cn.key'),
+    cert: fs.readFileSync('andyxie.cn.pem')
+}, app).listen(8080)
+
+// app.listen(8080)
 app_serve.listen(8079)