JandaBox ASP.NET Core Web API - Jandini/JandaBox GitHub Wiki
Create web API service with Serilog, AutoMapper and simple Health endpoint.
dotnet new webapibox -n MyWebService
Template options
--openApiAdd NuGet packages for OpenApi code generator.--windowsServiceAdd run as windows service.--exceptionMiddlewareAdd global exception handler middleware.--appNameAdd application name and version override option through appsettings or environment variables.--gitVersionAdd semantic versioning with GitVersion. The code created with this parameter can be only build from initialized git repository.--elasticLogAdd Elasticsearch Serilog sink and configuration.
Template features
- Repository Layout
- The
srcandbinfolders - Default
README.mdfile - Default
.gitignorefile - Default
launchSettings.jsonfile
- The
- Semantic Versioning
- Optional parameter
--gitVersionprovidesGitVersion.MsBuildpackage andGitVersion.ymlconfiguration file.
- Optional parameter
- Simple Health endpoint
- Name and version of the service
- AutoMapper
- DTO profiles and mapping
- Logging
Serilogfor web hosting- Serilog environment enrichers like computer name
- Configuration
appsettings.jsonfile- Override settings through environment variables
- Application Name and Version Override
- Optional parameter
--appOverrideprovides application name and version override throughappsettings.json.
- Optional parameter
- Run as Windows Service
- Optional parameter
--windowsServiceadd windows service start up.
- Optional parameter
- Open API
- Optional parameter
--openApiadd latest packages for OpenApi code generator.
- Optional parameter
- Start up
- Remove "Dto" postfix from DTOs class names for Swagger
- Log all environment variables in
DEBUGbuild - Validate AutoMapper profiles in
DEBUGbuild - Log web service name and version.
- Swagger website title is set to assembly name.
- Release build without debug symbols
- Conditional project parameters for
Releaseconfiguration to suppress debug symbols.
- Conditional project parameters for
- Unhandled exception handler through middleware
- Optional parameter
--exceptionMiddlewareprovides unhandled exception middleware.
- Optional parameter