v8.6.0
var express = require(‘express’);
var app = express();
app.get(‘/’ , function(req,res){ res.send(‘Works’); });
var logger = function(req,res,next) { console.log(‘Logging…’); next(); }
app.use(logger);
app.listen(3000 , function() { console.log(‘hello’);
});
when i try to access it in the browser i get ERR_CONNECTION_TIMED_OUT and I tried it in localhost it worked
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Check firewall ports, may need to be opened.