LeonidEfremov / aspnet.webapi.server

Base library for .NET Core API services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AspNet.WebApi.Server

NuGet Version Build Status SonarQube Coverage Libraries.io dependency status License

Base library for .NET Core API services.

About

Base library for .NET Core self-hosted API services. Provide all neccesary services for Web API like swagger documentation, healthcheck and metrics endpoints.

Requirements

  1. .NET 6.0 runtime and above
  2. MSVS 2022

Usage

Create new Host class:

public class Host : Server.Host { }

Define overrides int Startup class:

public class Startup : Server.Startup { }

Predefined API url

  1. / show default Web API page
  2. /swagger show SwaggerUI API Reference Documentation
  3. /env exposes environment information about the application e.g. OS, Machine Name, Assembly Name, Assembly Version etc.

Deployment

Windows

Install script

sc create "AspNet.WebApi.Server.Example" binpath= "dotnet %CD%\AspNet.WebApi.Server.Example.dll --run-as-service true" start= auto 
sc start "AspNet.WebApi.Server.Example"

uninstall script

sc stop "AspNet.WebApi.Server.Example"
sc delete "AspNet.WebApi.Server.Example"

Reference

  1. WebApi
  2. Swagger
  3. NSwag
  4. App.Metrics

Authors

About

Base library for .NET Core API services.

License:MIT License


Languages

Language:C# 100.0%