How markharrison/colorsapi works
ColorsAPI is an ASP.NET Core HTTP API for listing, looking up, creating or updating, deleting, and resetting colors. Clients enter through the hosted application and color routes; the controller validates requests and delegates color operations to a service, which maintains an in-memory collection of ColorsItem records initialized from configuration. The API also exposes random-color and name lookup routes, Swagger UI, and a configuration-information endpoint. The excerpts show controller-to-service calls and service state handling; they do not show a persistent datastore or external service integration.
Main entry points: ColorsService.cs Color Operations · Program.cs Application Host · ColorsController.cs Color Routes · ColorsItem.cs Color Record
Components 9
HTTP Hosting
- Application Host
Program.cs - Swagger UI
Program.cs
Color API
- Color Routes
Controllers/ColorsController.cs - Config Info
Program.cs - Color Operations
Services/ColorsService.cs
Runtime State
- Color Record
Models/ColorsItem.cs - In-memory Colors
Services/ColorsService.cs
Other components
- API Client
- Application Config
Connections 10
- API Client → Application Host: sends requests
Program.cs - Application Host → Color Routes: maps routes
Program.cs - Application Host → Swagger UI: serves UI
Program.cs - API Client → Config Info: requests info
Program.cs - Color Routes → Color Operations: delegates operations
Controllers/ColorsController.cs - Color Operations → In-memory Colors: reads and updates
Services/ColorsService.cs - Color Operations → Color Record: uses records
Services/ColorsService.cs - Application Host → Color Operations: registers singleton
Program.cs - Color Operations → Application Config: loads defaults
Services/ColorsService.cs - Config Info → Color Operations: formats diagnostics
Program.cs