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 and bin folders
    • Default README.md file
    • Default .gitignore file
    • Default launchSettings.json file
  • Semantic Versioning
    • Optional parameter --gitVersion provides GitVersion.MsBuild package and GitVersion.yml configuration file.
  • 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 through appsettings.json.
  • Run as Windows Service
    • Optional parameter --windowsService add windows service start up.
  • Open API
    • Optional parameter --openApi add latest packages for OpenApi code generator.
  • 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.
  • Unhandled exception handler through middleware
    • Optional parameter --exceptionMiddleware provides unhandled exception middleware.