How to run pug View Engine using Express? Last Updated : 24 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Pug or Jade is the template engine for NodeJS and browsers that are used for the process of developing dynamic HTML content. This template engine uses the indentation-based syntax like Python to generate the HTML markup, which makes it simpler to write and also to maintain the code. If we want to run the Pug, we need to install it using the npm (Node Package Manager) and then use the command to integrate it into the NodeJS application to render the Pug template into HTML. In this article, we will go through the detailed step-by-step process to run Pug. Steps to create Pug Application:Step 1: Create a backend server using the following command in your project folder.npm init -yStep 2: Install the necessary package in your server using the following command.npm i express pugFolder Structure:The updated dependencies in package.json file will look like:"dependencies": { "express": "^4.18.2", "pug": "^3.0.2"} HTML // views/index.pug doctype html html head title GeeksforGeeks Pug Run body h1 Welcome to GeeksforGeeks p Hello GeeksforGeeks. This is online Coding Learning Platform. JavaScript // server.js const express = require('express'); const app = express(); const port = 3000; app.set('view engine', 'pug'); app.get('/', (req, res) => { res.render('index'); }); app.listen(port, () => { console.log(`Server is running at http://localhost:${port}`); }); To run the pug application, we need to start the server by using the below command.node app.jsOutput: Comment More infoAdvertise with us Next Article How to run pug View Engine using Express? G gauravgandal Follow Improve Article Tags : Web Technologies Node.js PUG View Engine View Engine Similar Reads How to add pug engine in Express.js ? Express is a small framework that sits on top of Node.js web server functionality to simplify its APIs and add helpful new features. It makes it easier to organize your applicationâs functionality with middleware and routing; it adds helpful utilities to Node.jsâs HTTP objects; it facilitates the re 2 min read How to use Template Engines in Express JS ? Express.js is a popular web framework for Node.js that simplifies the process of building web applications. One of the key features of Express is its ability to integrate with template engines, allowing developers to dynamically generate HTML pages with data from their server. In this article, we'll 3 min read How to create routes using Express and Postman? In this article we are going to implement different HTTP routes using Express JS and Postman. Server side routes are different endpoints of a application that are used to exchange data from client side to server side.Express.js is a framework that works on top of Node.js server to simplify its APIs 3 min read How to Configure multiple View Engines in Express.js ? View engines present in web application framework are basically the template engines that allow us to embed dynamic content into the web pages, render them on the server, and send them to the client. With the help of these, we can serve dynamic data, and utilise the template inheritance properties t 3 min read How To Render Dynamic Lists Using EJS and Express ? Rendering of dynamic lists in EJS and Express mainly allows us to dynamically generate the HTML content which is based on the data from the backend server. We can render dynamic lists using the '<% %>' tags.Steps to Render Dynamic ListsStep 1: Create a directory for the projectmkdir rootcd roo 2 min read Like