0.1.3 • Published 7 years ago

refind v0.1.3

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

refind

Web server for Redis data including Refile support.

Use case

We want to publish data stored in Redis, including JSON objects that have been externalised to BLOB storage by https://github.com/evanx/refile

Config

See lib/config.js

Docker

You can build as follows:

docker build -t refind https://github.com/evanx/refind.git

See bin/test.sh https://github.com/evanx/refind/blob/master/bin/test.sh

Builds:

  • isolated network refind-network
  • isolated Redis instance named refind-redis
  • this utility evanx/refind

We populate our test keys:

populate() {
}

We build a container image for this service:

docker build -t refind https://github.com/evanx/refind.git

We interactively run the service on our test Redis container:

docker run --name refind-instance --rm -i \
  --network=refind-network \
  -e host=$redisHost \
  -e pattern='*' \
  refind

Implementation

See lib/main.js

Appication archetype

Incidently lib/index.js uses the redis-koa-app-rpf application archetype.

require('redis-koa-app-rpf')(require('./spec'), require('./main'));

where we extract the config from process.env according to the spec and invoke our main function.

See https://github.com/evanx/redis-koa-app-rpf.

This provides lifecycle boilerplate to reuse across similar applications.