Just playing with a .Net Core 2.2 Web Api
These instructions will get you a copy of the solution up and running on your local machine for development and testing purposes.
In a terminal window in the root of the solution;
-
Restore dependencies by using the
dotnet restore
command. -
Build the solution by using the
dotnet build
command. -
To run all tests, including integration tests;
- Provision the LocalStack and PostgreSQL resources by using the
docker-compose up -d
command. - Run all tests by using the
dotnet test
command.
- Provision the LocalStack and PostgreSQL resources by using the
-
To run the Web API project locally;
- Provision the LocalStack and PostgreSQL resources by using the
docker-compose up -d
command. - Run the application by using the
dotnet run --project WebApi/WebApi.csproj
command.
- Provision the LocalStack and PostgreSQL resources by using the
Running the Web API project locally will create a local test S3 Bucket, PostgreSQL database and table; before making the HTTP endpoints available.
On application close (ctrl
+ c
from the terminal window), the test database will be dropped and the S3 bucket, destroyed.
This project uses Swagger to document the API - see https://localhost:{port}/swagger/
when running the project.
- .Net Core Web API - Framework
- Docker - Infrastructure
- LocalStack - Local AWS Cloud Stack
- Badger.Data - Data Access
- Xunit / Fluent Assertions - Test Framework
This project is licensed under the MIT License - see the LICENSE file for details
Huge hat tip to Matt and Tim for making my life super easy with Badger.Data, and for providing clean open-sourced code which inspired me to write some of my own.