QA - Advanced Node and Express, Set up template engine

Hello everyone,
I made the following changes to server.js, which to me seems correct, however the tests on FCC are not successful
here are the links of my code

'use strict';
require('dotenv').config();
const express = require('express');
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const pug = require('pug');
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) => {
  res.render('index');

});

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

Please help
Thank you in advance
Best regards

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Hi @chaimabouchareb17

Try placing the set methods below the route.

Happy coding

thanks for the help
the tests passed by adding this snippet

const cors = require('cors');
app.use(cors());
1 Like