-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (26 loc) · 778 Bytes
/
Copy pathindex.js
File metadata and controls
32 lines (26 loc) · 778 Bytes
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 path = require("path")
const cors = require("cors")
const longjohn = require("longjohn")
const uploadRouter = require("./routes/uploadRouter")
const downloadRouter = require("./routes/dowloadRouter")
const app = express()
longjohn.async_trace_limit = -1
app.use(cors())
app.use(express.json())
app.use(express.static('public'));
app.use('/', express.static(path.join(`${__dirname }public`)))
app.use("/upload", uploadRouter)
app.use("/download", downloadRouter)
const start = async () => {
try {
app.listen(3000, () => {
// eslint-disable-next-line no-console
console.log(`server started on port ${3000}`)
})
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
}
}
start()