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: 23 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: 2024-10-16T12:34:36.270Z (2 months 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
```