# Set up a Template Engine (Hint)

**URL:** <https://forum.freecodecamp.org/t/set-up-a-template-engine-hint/414938>\
**Category:** freeCodeCamp Contributors\
**Tags:** contributing\
**Created:** [August 12, 2020, 7:33am UTC](https://forum.freecodecamp.org/t/set-up-a-template-engine-hint/414938 "2020-08-12T07:33:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Becky18](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@Becky18](https://forum.freecodecamp.org/u/Becky18)\
**Post date:** [August 12, 2020, 7:33am UTC](https://forum.freecodecamp.org/t/set-up-a-template-engine-hint/414938/1 "2020-08-12T07:33:06Z")

</div>

**What is your hint or solution suggestion?**  
(1) Pug should be installed as a dependency in the json package:

- { … ,  
“pug”: “^#.#.#.”  
}

(2) Assign Pug as the ‘view engine’ using the set method:

- app.set(‘view engine’ , ‘pug’);

(3) Change res.send(…) to res.render(…)

(4) Delete the “Pug template is not defined” argument of res.send() and change it to to the file path name that will render a file as static HTML in the browser

- The file path name should be rendered as a STRING.

- You want to render the **index.pug** file

- You don’t need to include the _.pug_ in the file name string

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/set-up-a-template-engine)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:32pm UTC](https://forum.freecodecamp.org/t/set-up-a-template-engine-hint/414938/2 "2021-06-01T18:32:32Z")

</div>

Closed on June 1, 2021, 6:32pm UTC


