Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Configuration server. Expose your configuration as a REST service.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
.gitignore
LICENSE
README.md
config.json
package.json
server.js

README.md

rest-confidence

This is a simple yet powerful configuration server. Tired of configuring many components in many different environments? Rest-confidence centralizes your settings and exposes them as a REST service.

Other use cases include using it as a service directory or as a foundation for A/B testing (read more). It uses confidence, with all it niceties now remotelly accesible through a simple REST service.

Configuration example

{
    "key1": "value",
    "key2": {
        "$filter": "env",
        "production": {
            "limit": 200
        },
        "$default": {
            "limit": 10
        }
    },
    "$meta": {
        "anykey": "anyvalue" // comments are also fine
    }
}

GET /

{
    "key1": "value",
    "key2": {
        "limit": 10
    }
}

GET /key2

{
    "limit": 10
}

GET /key2?env=production

{
    "limit": 200
}

GET /__raw

Gets the raw configuration file contents.

Install & run the server

npm install -g rest-confidence
rest-confidence <path-to-your-config-json>

It runs on port 8000 by default. You can override it defining a PORT environment variable (e.g. PORT=8000 rest-confidence).

Clients

TODO

  • Allow multiple configuration files / modules
  • Java client
  • Send broadcast datagrams to make itself visible to the clients (under evaluation)
  • Allow clients to subscribe and get notifications when a file/path changes.
  • Managment capabilities: PUT / POST methods (low priority)
  • Simple web UI (low priority)
  • Multitenant (very low priority, under evaluation)

License

MIT

Something went wrong with that request. Please try again.