Easy centralized application configuration for .NET apps. This is an ASP.NET WebAPI and Entity Framework version of the centralconfig service. Suitable for IIS based deployments.
- Grab the latest release,
- Unzip
- Create an IIS site that points to the unzipped location
- Create the database using the script (or the dacpac) and set the web.config connection strings
API path | Description |
---|---|
/ | Redirects to the /UI path (and the web based user interface) |
/config/get | Gets a single configuration item |
/config/set | Sets (creates or updates) a configuration item |
/config/remove | Removes a configuration item |
/config/getall | Gets all configuration items |
/config/getallforapp | Get all configuration items for a single application (plus the default * application) |
/applications/getall | Get all applications |
Most API operations expect a configitem object in the POST body that will be used to either filter (in a get operation), update or create (in a set operation), or remove an item (in a remove operation).
For example:
{
"application" : "AccountingReports",
"name": "ShowObscureFactoids",
"value": "true"
}
All operations will return an object that contain the fields status, message, and data.
For Example:
{
"status": 200,
"message": "Config item found",
"data": {
"id": 6,
"application": "AccountingReports",
"machine": "",
"name": "ShowFooterDates",
"value": "true",
"updated": "2016-08-11T14:49:38.1555535-04:00"
}
}
This operation retrieves a single configuration item. If it doesn't exist for the given application, it attemps to get it for the default application (*).
This is an HTTP POST
request
{
"application" : "AccountingReports",
"name" : "ShowFooterDates"
}
{
"status": 200,
"message": "Config item found",
"data": {
"id": 6,
"application": "AccountingReports",
"machine": "",
"name": "ShowFooterDates",
"value": "true",
"updated": "2016-08-11T14:49:38.1555535-04:00"
}
}
This operation sets the value of a single configuration item
This is an HTTP POST
request
{
"application" : "AccountingReports",
"name" : "ShowHeaderValues",
"value": "false"
}
{
"status": 200,
"message": "Config item updated",
"data": {
"id": 10,
"application": "AccountingReports",
"machine": "",
"name": "ShowHeaderValues",
"value": "false",
"updated": "2016-08-11T14:58:16.0132648-04:00"
}
}
This operation removes a single configuration item
{
"application" : "AccountingReports",
"name" : "ShowHeaderValues"
}
{
"status": 200,
"message": "Config item removed",
"data": {
"id": 0,
"application": "AccountingReports",
"machine": "",
"name": "ShowHeaderValues",
"value": "",
"updated": "0001-01-01T00:00:00Z"
}
}
This operation retrieves all configuration items.
This is a GET
request.
{
"status": 200,
"message": "Config items found",
"data": [
{
"id": 7,
"application": "AccountingReports",
"machine": "",
"name": "Name",
"value": "Accounting reporting system",
"updated": "2016-08-11T14:50:17.3451641-04:00"
},
{
"id": 6,
"application": "AccountingReports",
"machine": "",
"name": "ShowFooterDates",
"value": "true",
"updated": "2016-08-11T14:49:38.1555535-04:00"
},
{
"id": 8,
"application": "ITSupportDesk",
"machine": "",
"name": "ShowEmailLinks",
"value": "false",
"updated": "2016-08-11T14:50:51.4152237-04:00"
},
{
"id": 9,
"application": "ITSupportDesk",
"machine": "",
"name": "SupportNumber",
"value": "1 (415) 344-3200",
"updated": "2016-08-11T14:52:53.4456194-04:00"
}
]
}
This operation retrieves all configuration items for a specified application
This is an HTTP POST
operation
{
"application" : "AccountingReports"
}
{
"status": 200,
"message": "Config items found",
"data": [
{
"id": 7,
"application": "AccountingReports",
"machine": "",
"name": "Name",
"value": "Accounting reporting system",
"updated": "2016-08-11T14:50:17.3451641-04:00"
},
{
"id": 6,
"application": "AccountingReports",
"machine": "",
"name": "ShowFooterDates",
"value": "true",
"updated": "2016-08-11T14:49:38.1555535-04:00"
}
]
}
This operation retrieves all applications
This is an HTTP GET
operation.
{
"status": 200,
"message": "Applications found",
"data": [
"AccountingReports",
"AnotherApp",
"DouglasAdams",
"FormBuilder",
"ITSupportDesk",
"SomeOtherAppEntirely"
]
}