-
Notifications
You must be signed in to change notification settings - Fork 0
/
ss.js
executable file
·41 lines (40 loc) · 1.27 KB
/
ss.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
33
34
35
36
37
38
39
40
41
var express = require('express');
var app = express();
const WebSocket = require('ws');
var upload = require("multer")({ dest: '/home/shishcat1/uploadgram/express/uploads/' })
var uploaa2 = require("./wsw");
var useragent = require('express-useragent');
var { promisify } = require('util')
var fs = require("fs");
var unlinkAsync = promisify(fs.unlink)
app.use(useragent.express());
app.post('/api/upload',upload.single('upload'), (req, res) => {
uploaa2(res,req,"upload",WebSocket,unlinkAsync);
});
app.get('/api/search', (req, res) => {
uploaa2(res,req,"search",WebSocket);
});
app.use(express.urlencoded());
app.post('/api/search', (req, res) => {
uploaa2(res,req,"search",WebSocket);
});
app.post('/f/:file', (req, res) => {
uploaa2(res,req,"fileh",WebSocket);
});
app.get('/f/:file', (req, res) => {
uploaa2(res,req,"fileh",WebSocket);
});
app.post('/api/fnr/:file', (req, res) => {
uploaa2(res,req,"fnr",WebSocket);
});
app.get('/api/fnr/:file', (req, res) => {
uploaa2(res,req,"fnr",WebSocket);
});
app.get('/api/delete/:deletes', (req, res) => {
uploaa2(res,req,"del",WebSocket);
});
app.get('/api/ERGASTOLATORAPI', (req, res) => {
uploaa2(res,req,"ERGASTOLATORAPI",WebSocket);
});
var server = app.listen(5432, '0.0.0.0')
server.setTimeout(3600000);