Advanced Node and Express - Set up a Template Engine

Tell us what’s happening:

I couldn’t pass the test, I see no error syntax in my code…

###Your project link(s)

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

const app = express();

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

app.route('/').get((req, res) => {
  // Change the response to render the Pug template
  res.render('index');
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Listening on port ${PORT}`);
});`

solution: http://localhost:3000

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 OPR/119.0.0.0

Challenge Information:

Advanced Node and Express - Set up a Template Engine

Hi @lamto20050505

Try placing the set methods below the route.

Happy coding