fix(learn): Consistent Styling in Set up a Template Engine (#39657)

* Replace bold with code

* Typo

* Apply suggested verbiage change.

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* remove code tags from render

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
This commit is contained in:
Nicholas Carrigan
2020-09-24 07:10:29 -07:00
committed by GitHub
parent 1a66eac990
commit d33f5f82a7

View File

@ -15,9 +15,9 @@ A template engine enables you to use static template files (such as those writte
To set up <em>Pug</em> for use in your project, you will need to add it as a dependency in your package.json. Don't forget to add the name of the package and the version. Use the package.json for some examples of the correct syntax.
Express needs to know which template engine you are using. We will use the <b>set</b> method to assign 'pug' as the <b>'view engine'</b>. <code>app.set('view engine', 'pug')</code>
Express needs to know which template engine you are using. We will use the <code>set</code> method to assign <code>pug</code> as the <code>view engine</code> property's value: <code>app.set('view engine', 'pug')</code>
Your page will not load until you correctly <em>render</em> the index file in our <em>'views/pug'</em> directory.
Your page will not load until you correctly render the index file in the <code>views/pug</code> directory.
You should change the response for the <code>/</code> route to use <code>res.render()</code>. This method takes a string of a file path as an argument. The path can be a relative path (relative to views), or an absolute path, and does not require a file extension.