Template Engines allow us to use simple markups to specify page layouts. They will then convert this into a HTML page to return to our users. Pug is one you can use with express.
Link to Challenge :
https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/set-up-a-template-engineWritten Guide:
https://www.notion.so/ganeshh123/Set-up-a-Template-Engine-2778bd23959e400397cdf2942704fdf1Full Playlist for this course :
https://www.youtube.com/playlist?list=PLhGp6N0DI_1RL9djhgSH65pZhJ6xSyKX8All Writen Guides for this course :
https://www.notion.so/ganeshh123/ccf6039186334f83a54c1c9216f30e3cAll My Tutorials can be found at :
https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f2600:00 - What is a Template Engine?
00:33 - Example Project
01:06 - Setting up Pug with Express
app.set()
Assigns setting name to value. You may store any value that you want, but certain names can be used to configure the behavior of the server. These special names are listed in the app settings table.
https://expressjs.com/en/api.html#app.set03:30 - Pug Templates
05:14 - Rendering Pug Pages - response.render()
Renders a view and sends the rendered HTML string to the client.
https://expressjs.com/en/api.html#res.render05:30 - How Template Engines Work
06:40 - Challenge Solution
-————————————————————————————————————-
Pug is a high performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers. For bug reports, feature requests and questions, open an issue. For discussion join the chat room.
Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside a web browser. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.
Express.js, or simply Express, is a web application framework for Node.js. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js. Express runs between the server created by Node.js and the frontend pages of a web application. Express also handles an application's routing.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon
...
https://www.youtube.com/watch?v=2diyt3ERWcA