Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drnic/redis-counter-example
Tiny example app that talks to redis
https://github.com/drnic/redis-counter-example
Last synced: 29 days ago
JSON representation
Tiny example app that talks to redis
- Host: GitHub
- URL: https://github.com/drnic/redis-counter-example
- Owner: drnic
- Created: 2014-05-13T18:09:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-14T06:52:31.000Z (over 10 years ago)
- Last Synced: 2023-04-10T17:09:54.988Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 148 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Example redis app
=================![example](http://cl.ly/image/35140k2A2K1Z/example-redis-app.gif)
Installation
------------```
go get -u github.com/drnic/redis-counter-example
```Usage
-----### With configuration file
Create a configuration file with connection details to a Redis server:
```json
{
"host": "localhost",
"port": 6379
}
```Run the server with `-config PATH` to specify the Redis connection details:
```
redis-counter-example -config path/to/redis.json
```### With environment variables
Set the environment variables:
```
export REDIS_HOST=localhost
export REDIS_PORT=6379
export REDIS_PASSWORD=password
```Run the server and Redis connection details loaded from `$HOST` and `$PORT`:
```
redis-counter-example
```Development
-----------Within the project there is `config.json` which assumes a local Redis server (contains the example configuration above).
```
go run server.go -config config.json
```