leslie
June 14, 2025, 10:57am
1
Tell us what’s happening:
I’m having a difficult time passing this first test on setting up a template engine. The page has rendered on my localhost but all the tests are failing. I’ve already tried the reinstalling nodemoudules
solution . Here is the server.js code.
###Your project link(s)
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/136.0.0.0 Safari/537.36
Challenge Information:
Advanced Node and Express - Set up a Template Engine
ILM
June 14, 2025, 3:37pm
4
can you share your code? not a screenshot
‘use strict’;
require(‘dotenv’).config();
const express = require(‘express’);
const myDB = require(‘./connection’);
const fccTesting = require(‘./freeCodeCamp/fcctesting.js’);
const pug = require(‘pug’);
//const pug = require(‘pug’);
const app = express();
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.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}’);
});
ILM
June 30, 2025, 4:01pm
6
hi @chaimabouchareb17 , if you need help please create your own topic