http-system-logger 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/morgan.config.js +7 -1
- package/package.json +1 -1
package/dist/morgan.config.js
CHANGED
|
@@ -33,7 +33,13 @@ const ignoredRoutes = (process.env.IGNORED_ROUTES || '/api/health')
|
|
|
33
33
|
.split(',')
|
|
34
34
|
.map((route) => route.trim()); // Load ignored routes from environment variables
|
|
35
35
|
const morganMiddleware = (0, morgan_1.default)(function (tokens, req, res) {
|
|
36
|
-
if (ignoredRoutes.
|
|
36
|
+
if (ignoredRoutes.some(route => {
|
|
37
|
+
if (!route.includes('*')) {
|
|
38
|
+
return req.path === route; // Exact match for non-wildcard routes
|
|
39
|
+
}
|
|
40
|
+
const regex = new RegExp(route.replace('*', '.*'));
|
|
41
|
+
return regex.test(req.path);
|
|
42
|
+
})) {
|
|
37
43
|
return null; // Skip logging for ignored routes
|
|
38
44
|
}
|
|
39
45
|
return JSON.stringify({
|
package/package.json
CHANGED