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
--openApi
Add NuGet packages for OpenApi code generator.--windowsService
Add run as windows service.--exceptionMiddleware
Add global exception handler middleware.--appName
Add application name and version override option through appsettings or environment variables.--gitVersion
Add semantic versioning with GitVersion. The code created with this parameter can be only build from initialized git repository.--elasticLog
Add Elasticsearch Serilog sink and configuration.
Template features
- Repository Layout
- The
src
andbin
folders - Default
README.md
file - Default
.gitignore
file - Default
launchSettings.json
file
- The
- Semantic Versioning
- Optional parameter
--gitVersion
providesGitVersion.MsBuild
package andGitVersion.yml
configuration file.
- Optional parameter
- Simple Health endpoint
- Name and version of the service
- AutoMapper
- DTO profiles and mapping
- Logging
Serilog
for web hosting- Serilog environment enrichers like computer name
- Configuration
appsettings.json
file- Override settings through environment variables
- Application Name and Version Override
- Optional parameter
--appOverride
provides application name and version override throughappsettings.json
.
- Optional parameter
- Run as Windows Service
- Optional parameter
--windowsService
add windows service start up.
- Optional parameter
- Open API
- Optional parameter
--openApi
add latest packages for OpenApi code generator.
- Optional parameter
- Start up
- Remove "Dto" postfix from DTOs class names for Swagger
- Log all environment variables in
DEBUG
build - Validate AutoMapper profiles in
DEBUG
build - Log web service name and version.
- Swagger website title is set to assembly name.
- Release build without debug symbols
- Conditional project parameters for
Release
configuration to suppress debug symbols.
- Conditional project parameters for
- Unhandled exception handler through middleware
- Optional parameter
--exceptionMiddleware
provides unhandled exception middleware.
- Optional parameter