File tree 1 file changed +9
-11
lines changed
1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 7
7
router . get ( '/files(\/?[a-zA-Z0-9_-]?)*' , function ( clientRequest , clientResponse ) {
8
8
var options = {
9
9
host : '127.0.0.1' ,
10
- path : '/ files',
10
+ path :
clientRequest . url . replace ( '%2F' , '/' ) . replace ( '/ files', '/files/list/[email protected] ' ) ,
11
11
port : '3030' ,
12
12
method : 'GET' } ;
13
13
18
18
19
19
try {
20
20
data = JSON . parse ( chunk ) ;
21
- if ( data . error === 'undefined' ) {
22
- data . forEach ( function ( item ) {
23
- files . push ( {
24
- name : item . fileName || '' ,
25
- type : 'text' ,
26
- size : item . fileSize || '' ,
27
- modified : '' ,
28
- sharedWith : [ ] } ) ;
29
- } ) ;
30
- }
21
+ data . forEach ( function ( item ) {
22
+ files . push ( {
23
+ name : item . fileName || '' ,
24
+ type : item . extension || ( item . folder === true ? 'dir' : '' ) ,
25
+ size : item . fileSize || '' ,
26
+ modified : '' ,
27
+ sharedWith : [ ] } ) ;
28
+ } ) ;
31
29
} catch ( error ) {
32
30
return console . error ( error . message ) ;
33
31
}
You can’t perform that action at this time.
0 commit comments