Run with Docker Compose:
docker-compose up
Increment counter:
curl -X PUT http://localhost:7777/hits/foo
{
"hits": 4,
"lastActive": 1551839323
}
Get counter:
curl http://localhost:7777/hits/foo
{
"hits": 4,
"lastActive": 1551839323
}
Get all counters:
curl http://localhost:7777/hits
{
"bar": {
"hits": 3,
"lastActive": 1551838816
},
"baz": {
"hits": 1,
"lastActive": 1551838818
}
}
The following environment variables are supported:
| Name | Purpose | Default | Example |
|---|---|---|---|
| PORT | HTTP port on which to listen | 7777 | 7777 |
| REDIS_HOST | Backend Redis store host | localhost | 10.0.0.1 |
| REDIS_PORT | Backend Redis store port | 6379 | 6379 |
Prerequisites:
Build:
go build
Run:
./httphc
Test different configurations using Docker Compose.
docker-compose up --force-recreate --build httphc-datastore
This implementation requires that you set the following environment variables:
docker-compose up --force-recreate --build httphc-firestore
This implementation requires that you set the following environment variables:
docker-compose up --force-recreate --build httphc-redis redis
Note: this also starts a local Redis container.
This implementation requires that you set the following environment variables:
Optional:
Content type
Image
Digest
Size
35.7 MB
Last updated
over 4 years ago
docker pull outofcoffee/httphc