send information from nodejs to angular 5

0

I am using "node-dir" a module of nodejs to list the subdirectories and files of a folder, I would like to know how I can send this information to my component in angle 5. My node code is the following:

const  dir = require('node-dir');

dir.paths('./src/uploads/', function(err, paths) {
 if (err) throw err;
 console.log('files:\n',paths.files);
 console.log('subdirs:\n', paths.dirs);
});

I would like to be able to send the paths by http from my Server to my angle component, the code works and manages to bring me the files that I have in that directory but I need the path inside my component.

    
asked by holman sneyder 13.04.2018 в 09:49
source

0 answers