diff --git a/en/guide/using-template-engines.md b/en/guide/using-template-engines.md index 9921ce5b7a..5fcd7ae166 100755 --- a/en/guide/using-template-engines.md +++ b/en/guide/using-template-engines.md @@ -21,6 +21,20 @@ To render template files, set the following [application setting properties](/{{ This defaults to the `views` directory in the application root directory. * `view engine`, the template engine to use. For example, to use the Pug template engine: `app.set('view engine', 'pug')`. +### Manual Setup (Without Generator) + +If you are not using the Express generator, you must manually configure the engine to ensure Express can interface with it properly. While engines like Pug work out of the box, others (like Handlebars) require a specific wrapper package. + +For example, to use Handlebars manually: + +1. Install the `express-handlebars` package: `$ npm install express-handlebars` +2. Configure it in your `app.js`: + +```js +const { engine } = require('express-handlebars') +app.engine('handlebars', engine()) +app.set('view engine', 'handlebars') +``` Then install the corresponding template engine npm package; for example to install Pug: ```bash