bsdayo / kon

A ultra simple "centralized configuration server" for distributed systems using .NET ecosystem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kon

A ultra simple "centralized configuration server" for distributed systems using .NET ecosystem.

Scans configuration files in directory and serve them as a single flattened JSON object.

Currently, supports .json, .toml, and .ini files.

Getting started

Basic usage

Prepare some configuration files in a directory, like, hello.json:

{
  "Hello": "World!",
  "ConnectionStrings": {
    "MyDatabase": "Some=Thing; Here=There;"
  }
}

Serve all configuration files in current working directory:

$ kon

Curl it and check the response:

$ curl -s localhost:5000 | jq
{
  "Hello": "World!",
  "ConnectionStrings:MyDatabase": "Some=Thing; Here=There;"
}

Authentication

Add --token option (or set the TOKEN environment variable) to enable authentication:

$ kon --token myauthtoken

Then provide the token in Authorization header:

$ curl -s localhost:5000 -H "Authorization: Bearer myauthtoken" | jq

Change listening port

Specify listener prefix:

$ kon --urls http://127.0.0.1:80

License

MIT

About

A ultra simple "centralized configuration server" for distributed systems using .NET ecosystem.

License:MIT License


Languages

Language:C# 84.7%Language:Dockerfile 15.3%