Skip to content

mistuhk/DistanceCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

DistanceCalculator

OVERVIEW

The solution is split into 4 sub-projects and these are as follows:

DistanceCaculator.API: This is the API application that serves user requests. Adds support for SwaggerUI.

image

DistanceCaculator.API.EndpointGenerator: This project dynamically generates the endpoint definition for the API using IIncrementalGenerator interface. As this API uses the minimal API spec, it ensures that endpoints don't have to be explicitly defined in the startup [Program.cs] class.

Defined endpoints [templates] would be scanned during build and an endpoint mapping extension would be generated, and it automatically registers all detected endpoints on startup.

image

DistanceCaculator.API.IntegrationTests: The integration tests projects.

DistanceCaculator.API.UnitTests: The unit tests project.

HOW TO RUN THE APP

Containerisation has been implemented in the application, this means that the "DistanceCaculator.API" can be started without having to install dependencies locally (other than having docker CLI available).

To run the application...

In the solution directory, locate the docker-compose.yml file.

In the CLI, execute docker compose up -d --build.

This will spin up a container for the API.

The API can be accessed using the url: http://localhost:5223/

The API's Swagger UI can be accessed using the url: http://localhost:5223/swagger/index.html

HOW TO STOP THE APP Execute docker compose stop to abort execution of the app.

Execute docker compose down to remove the container and its dependent resources.

NOTE: In the DistanceCalculator.API, there's a DistanceCalculator.API.EndpointGenerator.http file that specifies a few integration tests that can be executed outside of the tests in the dedicated test projects.

image

This requires that the API is running [i.e. docker compose up has been executed]. However, the tests in the integration tests projects do not require the application to be running.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published