Skip to content

Commit

Permalink
Fix views path in example
Browse files Browse the repository at this point in the history
  • Loading branch information
bernard-ng committed Nov 27, 2020
1 parent 42322ce commit 5275789
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/intro.md
Expand Up @@ -149,8 +149,9 @@ _Credit for this example goes to [bernard-ng](https://github.com/bernard-ng)._

```javascript
const app = express();
const loader = new TwingLoaderFilesystem(app.get('views'));
const twig = new TwingEnvironment(loader)
const views = path.join(__dirname, 'views');
const loader = new TwingLoaderFilesystem(views);
const twig = new TwingEnvironment(loader);

app.engine('twig', async (path, options, callback) => {
try {
Expand All @@ -162,7 +163,7 @@ _Credit for this example goes to [bernard-ng](https://github.com/bernard-ng)._
});


app.set('views', path.join(__dirname, 'views'));
app.set('views', views);
app.set('view engine', 'twig');


Expand Down

0 comments on commit 5275789

Please sign in to comment.