Tell us what’s happening:
The view engine works and the page is properly rendered, all other tests pass but “View engine should be Pug” still fails. Googled and found several other people with the same problem but no solutions.
Your code so far
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const app = express();
const cors = require('cors');
app.use(cors());
fccTesting(app); //For FCC testing purposes
app.use('/public', express.static(process.cwd() + '/public'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'pug');
app.route('/')
.get((req, res) => {
res.render('pug/index.pug');
});
app.listen(process.env.PORT || 3000, () => {
console.log("Listening on port " + process.env.PORT);
});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
.
Challenge: undefined
Link to the challenge:
https://www.freecodecamp.org/learn/information-security-and-quality-assurance/advanced-node-and-express/set-up-a-template-engine