Skip to content

edneypitta/toggle-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

toggle-api

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.

Dependencies

  • .NET Core 2.0 SDK
  • Visual Studio 2017 15.3+ (optional)
  • SQL Server LocalDB

Running the application

  • Just dotnet run on src\Toggle.Api
  • It will automatically create and seed the database with 2 services (ids 1 and 2) and some toggles

Running tests

  • dotnet test on test\Toggle.Domain.Test
  • For coverage report, run cover.bat on the same folder

API resources

GET /api/toggles/:serviceId/:version

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.

GET /api/toggles/:id

Returns specified toggle, be it global or service-specific. If nonexistent, returns 404.

POST /api/toggles/:serviceId/:version

Body: { "name": "name", "value": "value" }

Creates toggle for the service and version specified. Returns 404 if service doesn't exist.

PUT /api/toggles/:id

Body: { "name": "new name", "value": "new value" }

Updates specified toggle. Returns 404 if toggle doesn't exist.

DELETE /api/toggles/:id

Deletes specified toggle. Returns 404 if toggle doesn't exist.

About

API for managing toggles (simple name/value stores) that supports global and service-specific toggles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published