Unsure which way to go... (express, pug, react, handlebars, ejs...)

Hello,

There are many tools that exist that accomplish the same thing which can be daunting to a beginner who’s figuring out which tools to use to get their first project done. I would like some advice on which way I should/could go about solving a little web development task I have set for myself. Here’s the situation…

I have a set of directories (Example : cat, dog, bird ) and each directory has a set of images in it (1.jpg, 2.jpg, 3.jpg) . I am using NodeJS with the ‘fs’ or ‘glob’ module to iterate through the directories and get their contents. From there I’d like to use said collected path information and file structure to display information on an end result web page.

The end result page is/can just be a flat simple HTML page with no interaction and would only be re-built if the content changes.

For this simple scenario do I necessarily need to use something like handlebars, pug, or ejs or can ExpressJS handle the generation of the html on the fly?

I know that there is no “Right answer” per-se but just would like advise on where I should sink my teeth in to start is all. Thank you for your time!

I think I solved my own question.

I will use ExpressJS to serve the content but “Pug” to be the templating engine that will generate the HTML files for me. Please correct me if I am wrong. Thanks otherwise! :slight_smile:

Yes, handlebars, pug, or ejs are just templating engines, used for server side rendering. The server dynamically translates them into html and can do some cool things with them as it does it. The client/browser never sees the pug or has any idea that there was any - it just sees html/css/javascript. You could have just have express send plain old html files, but many people prefer to use a templating engine. Many of the examples you’ll find on youtube are using a templating engine.

Howdy,

I appreciate the feedback and confirmation that I wasn’t far off with all this. Thank you for your time!