Day 90 Node.js Template Engines & App Structures

Yesterday I learned about express and today is a continuation of that. According to the Express website

“A template engine enables you to use static template files in your application. At runtime, the template engine replaces variables in a template file with actual values, and transforms the template into an HTML file sent to the client. This approach makes it easier to design an HTML page.”

Express by default has Jade running but you can change it to many different types of template engines. The template engine I used in the course was EJS. Creating HTML files on the fly is a very powerful feature.

The next topic discussed was about body parsers, which is another middleware. It parses HTTP requests in the body before handlers get to it since it is middleware. I used this for submitting surveys and parsing JSON. Parsing in JSON is useful since data is usually in JSON format.

Ended the courses today learning about RESTful APIs and JSON which I’ve gone over before in my blogs, but it is always nice to get a refresher on information. This ultimately led to the structuring on apps which in the course was this.

Most of the structuring is based on REST and the folders usually in an app. Then just seeing how to call modules and data from other folders in what order usually.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: