Tell us what’s happening:
- The /now endpoint should return the current time.
let express = require(‘express’);
let app = express();
require(‘dotenv’).config()
//4#
app.use(“/public”, express.static(__dirname + ‘/public’));
//7#
app.use((req, res, next) => {
console.log(${req.method} ${req.path} - ${req.ip}
);
next()
})
//3#
app.get(“/”, (req, res) => {
res.sendFile(__dirname + “/views/index.html”);
})
//#5
// app.get(“/json”, (req, res) => {
// res.json({“message”: “Hello json”});
// })
//#6
###Your project link(s)
solution: https://3000-freecodecam-boilerplate-zuxg16a5qip.ws-eu116.gitpod.io
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0
Challenge Information:
Basic Node and Express - Chain Middleware to Create a Time Server