mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Reqlogger exceptions, searchig: search till match percent and search in other subjs
This commit is contained in:
parent
bf4bdfb249
commit
64f41d6748
5 changed files with 61 additions and 46 deletions
|
@ -8,10 +8,16 @@ interface Options {
|
|||
export default function(options: Options): any {
|
||||
const loggableKeywords = options ? options.loggableKeywords : undefined
|
||||
const loggableModules = options ? options.loggableModules : undefined
|
||||
const exceptions = options ? options.exceptions : []
|
||||
|
||||
return function(req, res, next) {
|
||||
res.on('finish', function() {
|
||||
if (req.url.includes('_next/static')) {
|
||||
// TODO: test this
|
||||
const isException = exceptions.some((ex) => {
|
||||
return req.url.includes(ex)
|
||||
})
|
||||
|
||||
if (isException) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -26,7 +32,6 @@ export default function(options: Options): any {
|
|||
console.log(req.headers)
|
||||
}
|
||||
|
||||
// fixme: regexp includes checking
|
||||
const hasLoggableKeyword =
|
||||
loggableKeywords &&
|
||||
loggableKeywords.some((keyword) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue