-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
32 lines (26 loc) · 848 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const express = require("express");
const cors = require("cors");
const fileUpload = require("express-fileupload");
const uploadService = require("./controllers/upload");
const { pollingService } = require("./controllers/polling");
const {
downloadMusicService,
downloadVocalService,
} = require("./controllers/download");
const app = express();
const port = 8080;
app.use(cors());
app.use(fileUpload());
app.use(express.json());
app.get("/", (req, res) => {
// send html file index.html stored in root directory
res.sendFile(__dirname + "/index.html");
});
app.post("/api/upload", uploadService);
app.get("/api/polling", pollingService);
app.get("/api/download/vocal", downloadVocalService);
app.get("/api/download/music", downloadMusicService);
app.listen(port, () =>
console.log(`Vocals Splitter listening on port
${port}!`)
);