How can I access the content from a file in another file?

93
January 10, 2020, at 8:10 PM

I am currently trying to build a specific app: I want to transform xml-files in a directory and have a <div> created for each of them.

this is my app.get (dirname is a var I set up, containing the path to the xml files)

app.get('/test', function(req, res){
    res.render("test", { fs: fs, dirname: dirname, files: files});
});

for the route in question, while my test looks like the following:

<div class="container">
  <%  files.forEach(function (files) { %>
     <div>
        <%= files %>
    </div>
  <%  }); %>
</div>

So, at the moment I am generating a list of files, however, I want for every file to get its own div. These I want later to be grouped inside another div (that's the container, I have in my aforementioned code) instead of <%= files %>, what would I need to achieve this? ( I am setting up SaxonHEC together with saxon-node, as soon, as it is published in a current version on npm)

READ ALSO
After session destroyed and goes -1 in historie session is still &ldquo;active&rdquo; | NodeJS &amp; Express

After session destroyed and goes -1 in historie session is still “active” | NodeJS & Express

I have a login system and when the I log out (session is destroyed)Then when I go back to the page where I logged out from it still loads, but first when reload the page then it sees that the session is destroyed

94
Node Electron synch text append

Node Electron synch text append

I am trying to make an Electron app that will read given directory recursively and print file names to userLuckily I found a function on GitHub which makes exactly what I want

79
Data and salt arguments required error (authorization)

Data and salt arguments required error (authorization)

I'm a beginner in NodeJS and I've tried to make an authentication form using NodeJS + expressI want to make a validation for my password (when "confirmpassword" is different than "password" it should return nothing

205
Configuring express gateway to work with redis

Configuring express gateway to work with redis

I'm setting up an instance of the express gateway for routing requests to microservicesIt works as expected, but I get the following errors when I try to include redis in my system config

93