How doddatpivotal/dotnet-hello-world works
Project type and purpose
• This is a single‑service .NET Core Web API (“hello-world-api”) whose sole responsibility is to respond to HTTP GET requests at /api/hello with a “Hello World” payload.
• It can run locally on Kestrel (via dotnet run) or be deployed to Cloud Foundry (manifest.yml).
File structure
• Top‑level solution file: dotnet-hello-world.sln
• Single project folder: hello-world-api
• Controllers/HelloController.cs – defines the API endpoint
• Program.cs – host bootstrapping (Kestrel)
• Startup.cs – middleware configuration, routing, DI
• appsettings.json & appsettings.Development.json – configuration sources
• Properties/launchSettings.json – local launch profiles
• hello-world-api.csproj – NuGet dependencies, target framework
• manifest.yml – Cloud Foundry deployment descriptor
Extract additional insights from the README
• Running locally binds to localhost:5000
• On Cloud Foundry, a Gorouter routes external HTTP traffic to the instance as defined in manifest.yml
a. Main components
• Client (e.g., Browser or HTTP client)
• HTTP Router/Load Balancer (Cloud Foundry Gorouter or local reverse proxy)
• hello‑world‑api Service
• Kestrel Web Server
• Startup + Middleware Pipeline
• HelloController
• Configuration store (appsettings.json + environment overrides)
• Cloud Foundry Platform (optional)
b. Relationships & interactions
1. Client issues HTTP GET to /api/hello
2. Request flows through the CF Gorouter (in CF deployment) or directly to Kestrel (local)
3. Kestrel invokes Startup middleware, then routes to HelloController
4. Controller returns “Hello World” response to client
5. Configuration values (ports, logs) are loaded from appsettings or CF environment variables
c. Architectural patterns & principles
• Single‑responsibility microservice
• Convention‑based routing in ASP.NET Core
• Externalized configuration (12‑factor app)
• Dependency injection via Startup.cs
d. Key technologies & frameworks
• .NET Core / ASP.NET Core
• Kestrel HTTP server
• ASP.NET Core MVC (Controller)
• JSON configuration providers
• Cloud Foundry buildpack & Gorouter
Detail
• That Startup.ConfigureServices sets up MVC services and DI
• That appsettings.Development.json is only used under the Development environment