-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
47 lines (34 loc) · 1.1 KB
/
server.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
42
43
44
45
46
47
var express = require('express');
var cors = require('cors');
var app = express();
var puppet = require('./modules/puppet3.js')
var openload = require('./modules/openload1.js')
var bodyParser = require('body-parser');
app.use(express.static(__dirname+'/public'));
app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
// create todo and send back all todos after creation
app.post('/search',async function(req, res) {
var MovieName1 = req.body.MovieName;
var MovieAbsUrl =await puppet.DuckSearch(MovieName1);
const iop =[];
for (let g of MovieAbsUrl){
var t = g.toString().split("->");
var io={};
io.name=t[0];io.url=t[1];
iop.push(io);
}
console.log(iop);
res.send(iop);
});
///LInkshare
app.post('/LinkSharenet',async function(req, res) {
var LinkSharenetUrl = req.body.Link;
console.log("&&&&&&"+LinkSharenetUrl);
var MovieLink = await openload.LinkSharenet(LinkSharenetUrl);
console.log(MovieLink);
res.send(MovieLink);
});
app.listen(8001);
console.log("app running automatically ");