Skip to content
GitLab
Explore
Sign in
Commits on Source (2)
complete functions
· 33dc54c1
Giacomo Lavermicocca
authored
Dec 26, 2017
33dc54c1
Commit
· b48fe26a
Giacomo Lavermicocca
authored
Dec 26, 2017
b48fe26a
Show whitespace changes
Inline
Side-by-side
indexServer.js
View file @
b48fe26a
...
...
@@ -5,16 +5,18 @@ const path = require('path');
app
.
get
(
'
/getFiles
'
,
getFiles
);
var
PATH_TORRENTS
=
'
/root/.config/transmission-daemon/torrents/
'
;
function
getFiles
(
request
,
response
)
{
var
dirTree
=
(
'
/root/.config/transmission-daemon/torrents/
'
);
var
dirTree
=
(
PATH_TORRENTS
);
diretoryTreeToObj
(
dirTree
,
function
(
err
,
res
)
{
if
(
err
)
console
.
error
(
err
);
var
list
=
JSON
.
stringify
(
res
);
var
obj
=
{
"
currentDir
"
:
dirTree
,
"
list
"
:
list
};
response
.
send
(
JSON
.
stringify
(
obj
)
)
;
var
json
=
JSON
.
stringify
(
res
);
var
obj
=
{
"
currentDir
"
:
dirTree
,
"
res
"
:
res
};
var
str
=
JSON
.
parse
(
JSON
.
stringify
(
res
));
response
.
send
(
obj
);
});
}
...
...
@@ -22,7 +24,7 @@ function getFiles(request, response) {
app
.
get
(
/^
(
.+
)
$/
,
function
(
req
,
res
)
{
console
.
log
(
'
static file request :
'
+
req
.
params
);
//res.sendFile(__dirname + req.params[0]);
res
.
sendFile
(
'
/root/.config/transmission-daemon/torrents
'
+
req
.
params
[
0
]);
res
.
sendFile
(
PATH_TORRENTS
+
req
.
params
[
0
]);
});
var
diretoryTreeToObj
=
function
(
dir
,
done
)
{
...
...
nohup.out
View file @
b48fe26a
Mad Max Fury Road 2015 4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.a9ef06bf5361c7d7.torrent
Miss Peregrines Home For Peculiar Children 2016 .4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.7ac07b397c109d32.torrent
Mad Max Fury Road 2015 4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.a9ef06bf5361c7d7.torrent
Miss Peregrines Home For Peculiar Children 2016 .4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.7ac07b397c109d32.torrent
Mad Max Fury Road 2015 4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.a9ef06bf5361c7d7.torrent
Miss Peregrines Home For Peculiar Children 2016 .4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.7ac07b397c109d32.torrent
The Salt of the Earth 2014 BDRip 1080p HEVC ITA ENG AC3-NAHOM.53ec7624a5088c70.torrent
Mad Max Fury Road 2015 4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.a9ef06bf5361c7d7.torrent
Miss Peregrines Home For Peculiar Children 2016 .4K.UHD.2160p.BDRip Ita Eng x265-NAHOM.7ac07b397c109d32.torrent
The Salt of the Earth 2014 BDRip 1080p HEVC ITA ENG AC3-NAHOM.53ec7624a5088c70.torrent
Example app listening on port 3000!
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]
static file request : [object Object]