https://github.com/qubitproducts/log-requests
A service that simply logs all requests sent to it
https://github.com/qubitproducts/log-requests
ceh cmh implement
Last synced: 12 months ago
JSON representation
A service that simply logs all requests sent to it
- Host: GitHub
- URL: https://github.com/qubitproducts/log-requests
- Owner: QubitProducts
- Created: 2015-12-16T14:04:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-11T00:00:04.000Z (over 7 years ago)
- Last Synced: 2025-03-15T11:16:03.758Z (about 1 year ago)
- Topics: ceh, cmh, implement
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# log-requests
A service that simply echos and logs all requests sent to it
## Usage
```
npm install log-requests
log-requests --help
Usage: log-requests [options]
A service that simply echos and logs all requests sent to it
Options:
-h, --help output usage information
-V, --version output the version number
-p, --port Specify port [2345]
-u, --url Log url
-b, --body Log body
-q, --query Log query
-h, --headers Log headers
-c, --cookies Log cookies
Examples:
to log requests to http://localhost:2345:
log-requests
to log requests to http://localhost:2000:
log-requests -p 2000
log-requests --port 2000
to log just the url and cookies for requests to http://localhost:2000:
log-requests -p 2000 -uc
log-requests --port 2000 --url --cookies
to log just the headers query and body for requests to http://localhost:2000:
log-requests -p 2000 -hqb
log-requests -p 2000 --headers --query --body
```
## Output
```
log-requests
curl http://localhost:2345
```
Response:
```
{"url":"/","body":{},"query":{},"headers":{"host":"localhost:2345","user-agent":"curl/7.43.0","accept":"*/*"},"cookies":{}}
```
Log:
```
________________REQUEST SUMMARY________________
url: /
body:
query:
headers:
host: localhost:2345
user-agent: curl/7.43.0
accept: */*
cookies:
```
## Dependencies
nodejs (https://nodejs.org/en/)