Web API Project Template
Create Your First Arcus Web API Project
First, install the template from NuGet:
> dotnet new --install Arcus.Templates.WebApi
When installed, the template can be created with shortname: arcus-webapi
:
> dotnet new arcus-webapi --name Arcus.Demo.WebAPI
Features
Creates a starter web API project with by default configured:
- Provides basic health endpoint with ASP.NET Core health checks with OpenAPI support.
- Docker building file.
- Default console logger.
Configuration
And additional features available with options:
-au|--authentication
(defaultNone
)SharedAccessKey
: adds shared access key authentication mechanism to the API projectCertificate
: adds client certificate authentication mechanism to the API projectJWT
: adds JWT (JSON Web Token) authentication mechanism to the API projectNone
: no authentication configured on the API project.
-ia|--include-appsettings
(defaultfalse
): includes aappsettings.json
file to the web API project.-ec|--exclude-correlation
(defaultfalse
): excludes the capability to correlate between HTTP requests/responses from the API project.-eo|--exclude-openApi
(defaultfalse
): exclude the ASP.NET OpenAPI docs generation and UI from API project.-lo|--logging
(defaultConsole
)Console
: no extra logging mechanism except for the default console logging will be added to the web API project.Serilog
: adds Serilog as logging mechanism with request logging to the web API project.
Security
As part of this template the following HTTP header(s) are removed for security sake:
Server
header * Provides information concerning the Web API runtime