just a quick question about some Node + Express middleware that is outputting 1 call to console.log twice in my node cmd prompt. It just doesn't make sense and was wondering if someone could explain why this is occurring for me.
server.js
var express = require('express');
var app = express();
//Outputs in my console twice?!
app.use('/', function(req, res, next) {
console.log('Request Logged by Node+Express Server Middleware @ ' + Date());
next();
});
app.get('*', function(req, res) {
res.send('Hey world.');
});
app.listen(1337);
I figured out what was going on, Chrome was making an additional request to favicon.ico, thus the double outputs. Makes sense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With