Tell us what’s happening:
I am stuck on this step. I have looked into several resources and not able to find the error.
###Your project link(s)
let express = require('express');
let app = express();
require('dotenv').config();
app.use(express.static(__dirname + "/public"));
app.use(express.static(__dirname + "/views"));
app.use("/", (req, res, next) => {
console.log(`${req.method} ${req.path} - ${req.ip}`);
next();
})
app.get("/now", (req, res, next) => {
req.time = new Date().toString();
next();
}, (req, res) => {
res.send(req.time);
})
app.get("/json", (req, res) => {
if (process.env.MESSAGE_STYLE === "uppercase") {
res.json({"message": "Hello json".toUpperCase()})
} else {
res.json({"message": "Hello json"});
}
})
module.exports = app;
solution: https://3000-freecodecam-boilerplate-8kewxaqal7s.ws-us116.gitpod.io
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Challenge Information:
Basic Node and Express - Chain Middleware to Create a Time Server