Advanced Node and Express - Set up a Template Engine

Tell us what’s happening:

When I render the ./views/pug it gets and error: Here is my code:

'use strict';
const express = require('express');
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');

const app = express();

fccTesting(app); //For FCC testing purposes
app.set('view engine', 'pug');
app.use('/public', express.static(process.cwd() + '/public'));
app.use(express.urlencoded({ extended: true }));


###Your project link(s)


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge Information:

Advanced Node and Express - Set up a Template Engine

Where is the rest of your code?

After that, add another set method that sets the views property of your app to point to the ./views/pug directory. This tells Express to render all views relative to that directory.

Finally, use res.render() in the route for your home page, passing index as the first argument. This will render the pug template.