A simple To-Do API application using .NET Core 3.1. The purpose of this repository is to act as a baseline when demonstrating .NET Core 3.1 features.
The following tools are required to run this application:
- .NET Core 3.1 SDK
- A text editor or IDE (Integrated Development Environment) such as Visual Studio or VS Code
- cURL Optional - allows execution of the scripts for testing the endpoints
To build and run the application, run the following commands from the terminal when in the root project folder:
dotnet build
dotnet run
Once running, the application should be listening on the following ports:
- 5000 - the insecure HTTP port. Since the application uses HSTS, all requests will be redirected to the secure port
- 5001 - the secure HTTPS port
The following endpoints are then available:
HTTP Verb | Route |
---|---|
GET | /api/todo/{fail} |
PUT | /api/todo/{fail} |
PATCH | /api/todo/{id}/{fail} |
DELETE | /api/todo/{id}/{fail} |
Route parameters:
fail
- optional boolean (true or false) value- Defaults to
false
- When
true
, simulates an error in the endpoint
- Defaults to
id
- required integer value that specifies the unique identifier of the record to be updated or deleted
Samuel Slade
Independent Consultant
Director | Slade Software Ltd
samuel.slade@sladesoftware.co.uk