Whenever I reload my page, the error message in the program is logged on the output terminal. I can't understand why.
const http = require('http')
const server = http.createServer((req,res)=>{
if(req.url === '/'){
res.end('Home Page')
return;
}
else if(req.url === '/about'){
res.end('About Page')
return;
}else{
res.end('Error page')
console.log('Error page encountered!');//?
}
})
server.listen(5000,()=>{
console.log('Server listening to port 5000.......');
})