Advanced Node and Express - Set up a Template Engine

Tell us what’s happening:

The tests don’t pass even though the code is for sure correct

‘use strict’;

require(‘dotenv’).config();

const express = require(‘express’);

const cors = require(‘cors’);

const myDB = require(‘./connection’);

const fccTesting = require(‘./freeCodeCamp/fcctesting.js’);

const app = express();

fccTesting(app); //For FCC testing purposes

app.use(cors());

app.use(‘/public’, express.static(process.cwd() + ‘/public’));

app.use(express.json());

app.use(express.urlencoded({ extended: true }));

app.set(‘view engine’, ‘pug’);

app.set(‘views’, ‘./views/pug’);

app.route(‘/’).get((req, res) => {

res.render(‘index’);

});

const PORT = process.env.PORT || 3000;

app.listen(PORT, () => {

console.log('Listening on port ’ + PORT);

});

I even added corses and checked the solution with several AI. It should work but it doesn’t.

###Your project link(s)

solution:

Your browser information:

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

Challenge Information:

Advanced Node and Express - Set up a Template Engine

What might be the cause of all this?