Building an express app with morgan 1.9.0
and browser-refresh 1.7.2
.
Morgan seems to be ignoring the skip
option. My app is initialized with
const skipFcn = (req, res) => req.path.startsWith('/static/views')
app.use((req, res, next) => {
console.log('test:', skipFcn(req, res))
next()
})
app.use(morgan('combined', {
skip: skipFcn
}))
But in my logs I'm still getting hundreds of hits from browser-refresh
:
test: true
::1 - - [14/Oct/2017:10:09:07 +0000] "GET /static/views/project$0.0.0/views/components/service-form.marko.jsHTTP/1.1" 200 3748 "http://localhost:4002/admin/services" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
app.use(morgan(...
bit to confirm it's the only logging in play here. If it isn't something simple like that I suggest attaching the Chrome debugger to your Node and stepping through.