-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (22 loc) · 787 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
const express = require('express');
const fileUpload = require('express-fileupload');
const { join: path } = require('path');
const app = express();
const basicRoute = require('./routes/basic');
const filesRoute = require('./routes/files');
const videoStreamRoute = require('./routes/videoStream');
app.disable('x-powered-by');
app.use(fileUpload({
createParentPath: true
}));
app.use('/', express.static(path(__dirname, "uploads")));
app.use('/stream', videoStreamRoute);
app.use('/', filesRoute);
app.use('/', basicRoute);
app.head('/', async(req, res) => {
res.set('status', 'online');
});
app.listen(1440, () => {
console.log(`[ ${new Date().toLocaleString()} ] Server Started...`);
console.log(`[ ${new Date().toLocaleString()} ] Listening on port 1440.`);
});