I have used C#, and Visual Studio for Mac (M1, arm64) to develop and build the assignment. The application is available on the port 9091 as per defined in the documentation, and the address is: https://localhost:9091/.
Swagger can be accessed on: https://localhost:9091/swagger/index.html
API Endpoint: https://localhost:9091/api/gwp/avg
I've created a controller named CountryGWPController.cs
inside the Controllers folder to catch the POST request on the route api/gwp/avg
, which calls a service named CSVService
defined under the Services folder, to read the CSV file asynchronously, and return the desired output.
- Successful compile and run :
![Screenshot 2023-12-29 at 3 58 24 PM](https://private-user-images.githubusercontent.com/76272472/293346740-e521976a-5eae-4570-b2b9-1a72c8199d0e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwOTI5MDksIm5iZiI6MTcyNDA5MjYwOSwicGF0aCI6Ii83NjI3MjQ3Mi8yOTMzNDY3NDAtZTUyMTk3NmEtNWVhZS00NTcwLWIyYjktMWE3MmM4MTk5ZDBlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDE4MzY0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFlNmQ1OTBlMmI4NzE5MTRkY2E0ZmQ4YzVhMmUxMzg2Y2ExZTc3NTE0ZmEzYzdhMTQzMGJkY2RjZmQwZTNlNWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yQptf3KzHpBqm0AWpef4pCSLzXsD0szbXIRMEj6AE0s)
- API Endpoint response
![Screenshot 2023-12-29 at 3 58 49 PM](https://private-user-images.githubusercontent.com/76272472/293346806-4654a507-fe2c-4d9a-9f24-2531a88a345f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwOTI5MDksIm5iZiI6MTcyNDA5MjYwOSwicGF0aCI6Ii83NjI3MjQ3Mi8yOTMzNDY4MDYtNDY1NGE1MDctZmUyYy00ZDlhLTlmMjQtMjUzMWE4OGEzNDVmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDE4MzY0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUxYTdlMWIxYjA4MGQ3MzZiMGRlMDRjNDgzZTkxMTNjNTJhMWI0MWJiODA4ZmM1NWZkYzQ2M2IwY2EyMGMyODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._-dCf2yuKT86E9qBtSAm6TBeEhymi6UlaQRtrZz7AaQ)
- Asynchronous calls
- Dependency Injection / Inversion of control