Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samhammerag/samhammer.aspnetcore.healthchecks
Health checks for apsnet core
https://github.com/samhammerag/samhammer.aspnetcore.healthchecks
Last synced: about 1 month ago
JSON representation
Health checks for apsnet core
- Host: GitHub
- URL: https://github.com/samhammerag/samhammer.aspnetcore.healthchecks
- Owner: SamhammerAG
- License: mit
- Created: 2024-06-13T06:25:21.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-13T07:26:02.000Z (7 months ago)
- Last Synced: 2024-11-02T16:39:23.344Z (2 months ago)
- Language: C#
- Size: 16.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Samhammer.AspNetCore.HealthChecks
A collection of health checks for AspDotnet core
## Usage
### FilesystemDirectory
[nuget-image-filesystemdirectory]:https://img.shields.io/nuget/v/Samhammer.AspNetCore.HealthChecks.FilesystemDirectory?label=Samhammer.AspNetCore.HealthChecks.FilesystemDirectory
[nuget-url-filesystemdirectory]:https://www.nuget.org/packages/Samhammer.AspNetCore.HealthChecks.FilesystemDirectory/This check verifies if a directory exists. Also it can test write access by creating and deleting a test file (Filename: "randomGuid.health").
- Add nuget package [![Nuget][nuget-image-filesystemdirectory]][nuget-url-filesystemdirectory]
- Register in Program.cs as shown below```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddHealthChecks()
.AddDirectory(o =>
{
o.DirectoryPath = "/opt/app/mydir"; // The path to a directory
o.FailForEmptyPath = true // If set to true the check fails if the path is null or empty
o.TryWrite = true; // If set to true the check creates a test file to verify write access
});
```## How to publish package
- Create a tag and let the github action do the publishing for you