- Create the following folder/file structure:
- Create a Express web server using port 3000
- Create the following routes:
- GET '/': Returns the following JSON object
{
"status": 200,
"message": "Este request/response está OK"
}
- Create the following middleware:
const requestTime = (req, res, next) => {
const message = `Request: ${req.baseUrl} ${Date.now()}`;
console.log(message);
next();
};
- Configure express to use the
requestTime
middleware
- You should see the following output on each request (
Server console
):