- Download the solution from Git (https://github.com/calielc/Base64Diff)
- Build the solution Caliel.Base64Diff.sln using Visual Studio 2017
- Execute the main project Caliel.Base64Diff.Api either on IIS Express or Self hosted
- Open your favorite web browser and go to http://localhost:63634/docs.
There are two configurations for port: 63634 to IIS Express and 63635 to Self hosted.
But you can change it in the Project Configuration
- Visual Studio 2017
- .NET Core SDK 2.0
The solution has been splitted into 3 layers, and there are 4 test projects.
- Caliel.Base64.Api
This layer allows users make requests in order to save content into left or right side.
- Caliel.Base64.Data
This layer reads and writes data. Now the project is using File System to write binaries files (folder c:\temp) and, in the future, this could be changed.
- Caliel.Base64.Domain
This layer does the magic tricks, the API only receives HTTP request and send it to Domain in order to validate, compare and persist data.
- Caliel.Base64.API.Tests,
- Caliel.Base64.Domain.Tests
- Caliel.Base64.Data.Tests
Unit tests projects to referred project.
- Caliel.Base64.Tests
Integration tests, from end-to-end. All tests post to API and wait for response, like a real enviromnent.
The API owns 5 endpoints as specified below:
Endpoint | Description |
---|---|
GET /docs | Documentation auto-generated by Swagger |
GET /v1/ping | Ping to check if service is avaiable |
POST /v1/diff/{id}/left | Post left side of Diff (should be in base64 form) |
POST /v1/diff/{id}/right | Post Right side of Diff (should be in base64 form) |
GET /v1/diff/{id} | Compare and returns similarity between left and right side |
{
"data": "Q2FsaWVsIENvc3Rh"
}
{
"similarity": "AreEquals",
"diffs": [
{
"offset": 0,
"length": 0
}
]
}
If you want know more about endpoints and parameters you can check at http://localhost:63634/docs and see online documentation.