An ASP.NET Core Web API built on .NET 10, structured for microservices development.
BasicAPI/
├── Controllers/ # API controllers — one per resource, route via [Route("api/[controller]")]
├── Models/ # Request/response data models and domain entities
├── Services/ # Business logic — interfaces in this folder, implementations alongside
├── Properties/ # Launch settings (ports, environment profiles)
├── appsettings.json # Base configuration
├── appsettings.Development.json # Development overrides
└── Program.cs # App bootstrap: DI registration, middleware pipeline
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check (returns 200 Healthy) |
| GET | /api/example |
List all example items |
| GET | /api/example/{id} |
Get a single item by ID |
| POST | /api/example |
Create a new item |
| DELETE | /api/example/{id} |
Delete an item by ID |
| GET | /openapi/v1.json |
OpenAPI spec (development only) |
dotnet runThe API starts on https://localhost:5001 (or the port defined in Properties/launchSettings.json).
- Model — add a class in
Models/ - Service interface — add
IYourService.csinServices/ - Service implementation — add
YourService.csinServices/ - Register — add
builder.Services.AddSingleton<IYourService, YourService>();inProgram.cs - Controller — add
YourController.csinControllers/decorated with[ApiController]and[Route("api/[controller]")]
GET /health is served by the ASP.NET Core health check middleware. Additional checks (database, downstream services) can be registered via builder.Services.AddHealthChecks().AddCheck(...).