-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add #94 Type support for http-logger added #178
Changes from 3 commits
7b0a71e
8535b0d
4fbba31
262a974
cf512ec
cc3c276
31db152
99194c6
762b821
223c25a
a75a6a5
f34257f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
{ | ||
"name": "@sliit-foss/http-logger", | ||
"version": "1.3.1", | ||
"description": "Http logging middleware for Express.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "node ../../scripts/esbuild.config.js", | ||
"build:watch": "bash ../../scripts/esbuild.watch.sh", | ||
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/http-logger", | ||
"lint": "bash ../../scripts/lint.sh", | ||
"release": "bash ../../scripts/release.sh", | ||
"test": "bash ../../scripts/test/test.sh" | ||
}, | ||
"dependencies": { | ||
"@sliit-foss/module-logger": "1.3.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sliit-foss/npm-catalogue.git" | ||
}, | ||
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/http-logger/readme.md", | ||
"keywords": [ | ||
"logging", | ||
"http-logging", | ||
"middleware" | ||
], | ||
"author": "SLIIT FOSS", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sliit-foss/npm-catalogue/issues" | ||
} | ||
} | ||
{ | ||
"name": "@sliit-foss/http-logger", | ||
"version": "1.3.1", | ||
"description": "Http logging middleware for Express.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "node ../../scripts/esbuild.config.js", | ||
"types": "types/index.d.ts", | ||
"build:watch": "bash ../../scripts/esbuild.watch.sh", | ||
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/http-logger", | ||
"lint": "bash ../../scripts/lint.sh", | ||
"release": "bash ../../scripts/release.sh", | ||
"test": "bash ../../scripts/test/test.sh" | ||
}, | ||
"dependencies": { | ||
"@sliit-foss/module-logger": "1.3.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sliit-foss/npm-catalogue.git" | ||
}, | ||
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/http-logger/readme.md", | ||
"keywords": [ | ||
"logging", | ||
"http-logging", | ||
"middleware" | ||
], | ||
"author": "SLIIT FOSS", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sliit-foss/npm-catalogue/issues" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { RequestHandler, Request } from "express"; | ||
|
||
/** | ||
* @description Options for logging middleware function | ||
*/ | ||
type HttpLoggerOptions = { | ||
whitelists?: string[]; | ||
loggable?: string[] | ((req: Request) => Record<string, any>[]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you've mentioned the entire express There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay will do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Akalanka47000 can you merge this. |
||
}; | ||
|
||
/** | ||
* @description Creates a HTTP logging middleware for Express.js | ||
* @param {HttpLoggerOptions} options Add options to customize logging | ||
* @returns {RequestHandler} A middleware function which will log http requests | ||
*/ | ||
declare const httpLogger: (options: HttpLoggerOptions) => RequestHandler; | ||
|
||
export default httpLogger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the wrong place, shall we bring it out ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it was mistakenly added. Fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the requested changes.