You might want to install .NET Core SDK 6 first, and sudo npm install nswag -g
next.
The service can be started
-
"locally" by running (might take a little time to compile the code):
dotnet run --project .\src\Api\ServiceTemplate.csproj
or on Linux:
dotnet run --project ./src/Api/ServiceTemplate.csproj
-
Or you can start the service and run the tests with means of
docker-compose
:docker-compose up --build --abort-on-container-exit
Unfortunately, on Linux, the stable
docker-compose
is quite old, so it doesn't supportservice_started
:depends_on: api: # condition: service_healthy condition: service_started
So if you want to use
docker-compose
, please use Windows and the latest Docker Desktop or Rancher Desktop. -
If you press
F5
button inVisual Studio Code
orVisual Studio
, the Swagger page will be shown in the browser window soon.
The Swagger page can be accessed through: http://localhost:5000/swagger
.
There are two implementations:
- The in-memory store, this is the default, as it is highly tested by unit tests,
- and the persistent one (SQlite), it can be enabled by editing the
Startup.cs
insrc/Api
.
- ASP.NET Core 6 WebAPI
- Swagger for interface description and visualization (
/swagger
) - Docker and docker-compose
- Entity Framework Core with SQLite
- Serilog structured logging (console logger)
- Prometheus.NET for metrics (
/metrics
) - Correlation ID middleware (
X-Correlation-ID
in header)