Hi! This is an API for managing toggles (simple name/value stores) that supports global and service-specific toggles. It uses .NET/ASP.NET Core, Entity Framework Core, xUnit, Fluent Assertions and OpenCover/ReportGenerator.
- .NET Core 2.0 SDK
- Visual Studio 2017 15.3+ (optional)
- SQL Server LocalDB
- Just
dotnet run
on src\Toggle.Api - It will automatically create and seed the database with 2 services (ids
1
and2
) and some toggles
dotnet test
on test\Toggle.Domain.Test- For coverage report, run
cover.bat
on the same folder
Returns all toggles for the service and version specified.
It merges the global toggles with the specific ones for the service, so if there's a global toggle named isButtonRed
with value true
and a service-specific one with the same name but with value false
, it will return false
.
Compare the results of /api/toggles/1/1.0
and /api/toggles/2/1.0
for reference.
Returns specified toggle, be it global or service-specific. If nonexistent, returns 404.
Body: { "name": "name", "value": "value" }
Creates toggle for the service and version specified. Returns 404 if service doesn't exist.
Body: { "name": "new name", "value": "new value" }
Updates specified toggle. Returns 404 if toggle doesn't exist.
Deletes specified toggle. Returns 404 if toggle doesn't exist.