koa-lvcnf
Koa middleware for lvcnf.
Installation
npm i koa-lvcnf
Usage
const Koa = const app = const Config = const koaConfig = // config instance to pass into the middlewareconst config = initialConfig // other middlewaresapp // route prefix app
GET /config => all config values
GET /config/foo => config for foo
GET /config/foo.bar.baz => the baz value in { foo: { bar: { baz } } }
DELETE /config/foo.bar.baz => deletes foo.bar.baz
POST /config { "foo": { "bar": 1 } } => merged with current config
PATCH /config/foo.bar.baz => updates foo.bar.baz
Securing The Endpoint
There's no built in security, but you can easily wrap this in your own middleware. Example:
const jwt = app