Timeout has occurred - Basic Node and Express - Implement a Root-Level Request Logger Middleware

this is my code:

var express = require('express');
var app = express();

// --> 7)  Mount the Logger middleware here
app.use(function middleware(req, res, next) {
  var result = req.method + ' ' + req.path + ' - ' + req.ip;
  console.log(result);
  next();
});

I don’t know what is wrong and how to change it, it keeps saying Timeout has occured

// GET IT EASY THIS WAY
//:relaxed:

app.use(function middleware(req,res,next) {
var string = req.method + ’ ’ + req.path + ’ - ’ + req.ip;
res.send(string);
console.log(string);
next();
});

@AndrewFan0408 There isn’t anything wrong with it.

Maybe the server was facing some inconsistencies. If you try again, it should work.

@DHINDSA Also, it’s not a good idea to post solutions in the forum like that since we don’t want to give them away. Instead, it would be better if you give clues on how to solve the problems.