Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexcb/httpd-url-counter
returns the number of times a URL has been requested
https://github.com/alexcb/httpd-url-counter
Last synced: about 1 month ago
JSON representation
returns the number of times a URL has been requested
- Host: GitHub
- URL: https://github.com/alexcb/httpd-url-counter
- Owner: alexcb
- Created: 2022-11-25T18:13:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-25T18:19:13.000Z (almost 2 years ago)
- Last Synced: 2024-06-19T23:04:11.657Z (5 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## httpd-url-counter
displays the number of times an endpoint has been HTTP GET'ed
## Example
Start the server:
$ go run main.go
2022-11-25T18:11:47Z 127.0.0.1:51814 /foo/bar 0
2022-11-25T18:11:50Z 127.0.0.1:44272 /foo/bar 1
2022-11-25T18:11:53Z 127.0.0.1:44306 /foo 0
2022-11-25T18:11:54Z 127.0.0.1:44314 /foo/bar 2Perform some HTTP GET's
$ curl http://127.0.0.1:1234/foo/bar
0
$ curl http://127.0.0.1:1234/foo/bar
1
$ curl http://127.0.0.1:1234/foo
0
$ curl http://127.0.0.1:1234/foo/bar
2