Distributed Configuration Manager for ASP.NET Core Applications
- Install package to your project
dotnet add package Kofti
- Add services to your service container with extensions
...
services.Configure<KoftiOptions>(Configuration.GetSection("Kofti"));
services.AddKofti();
...
- Add redis and kofti configs to appsettings.json file
"Kofti": {
"ApplicationName": "KoftiExample",
"OrchestratorName": "KoftiManager",
"RedisServers": "localhost:6379",
"RedisAllowAdmin": true,
"RedisPassword": "MyP@ssw0rd"
}
- Inject 'IConfigService' and get config
private readonly IConfigService _configService;
public ValuesController(IConfigService configService)
{
_configService = configService;
}
[HttpGet("{key}")]
public ActionResult<string> Get(string key)
{
return _configService.GetValue<string>(key, $"Not available config key: '{key}'");
}
-
Clone this repo and open 'Kofti.Manager' project
-
Change configuration for your enviromment (database connection string, redis and kofti configs)
-
Run migrations
dotnet ef database update
- Run or deploy application
- ASP.NET Core 2.2
- Redis
- Unit tests
- Kofti.Manager refactor and fully dockerize app
- More examples and documentation
- If you want to contribute to codes, create pull request
- If you find any bugs or error, create an issue
This project is licensed under the MIT License