Skip to content

Commit

Permalink
Merge pull request #68 from wemogy/robinmanuelthiel-patch-2
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
robinmanuelthiel authored Apr 27, 2024
2 parents b12914a + 1f1f701 commit ed60a09
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@ public Startup(IConfiguration configuration)
_options
.AddMiddleware<ApiExceptionFilter>();

// Add Swagger
// Swagger
_options
.AddOpenApi("v1")
.WithApiGroup("public", "Fancy API", "This is my fancy API.")
.WithSecurityScheme(SecuritySchemeDefaults.JwtBearer);

// Add Monitoring
// Monitoring
_options
.AddMonitoring()
.WithMeter(Observability.Meter.Name)
.WithApplicationInsights(Configuration["AzureApplicationInsightsConnectionString"])
.WithPrometheus();

// Health Checks
_options.ConfigureHealthChecks(builder =>
builder.AddCheck("MyHealthCheck", () => HealthCheckResult.Healthy("Everything is fine."));
}
```

Expand Down Expand Up @@ -90,14 +94,27 @@ For modern or Minimal API services (introduced in .NET 6), this would look simil

```csharp
var options = new StartupOptions();

// Middleware
options
.AddMiddleware<ApiExceptionFilter>();

// Swagger
options
.AddOpenApi("v1")
.WithApiGroup("public", "Fancy API", "This is my fancy API.")
.WithSecurityScheme(SecuritySchemeDefaults.JwtBearer);

// Monitoring
options
.AddMonitoring()
.WithMeter(Observability.Meter.Name)
.WithApplicationInsights(Configuration["AzureApplicationInsightsConnectionString"])
.WithPrometheus();

// ...
// Health Checks
options.ConfigureHealthChecks(builder =>
builder.AddCheck("MyHealthCheck", () => HealthCheckResult.Healthy("Everything is fine."));

app.AddDefaultSetup(options);
app.UseDefaultSetup(app.Environment, options);
Expand Down

0 comments on commit ed60a09

Please sign in to comment.