I'm using the following middleware :
app.use(function(req,res,next){
console.log(req.url)
next()
});
but it catches every request, including images/css/js etc...
If I just want to catch the actions, what should I do?
You could put your "static handler" middleware before this one, if the request matches the static middleware route, it should not reach your middleware at all.
So try:
app.use(express.static(__dirname + '/public'));
app.use(function(req,res,next){
console.log(req.url)
next()
});