The hacker new api, is a service that returns the last news from https://news.ycombinator.com/
- mkdir hackernewsapi
- git clone https://github.com/edsondiasalves/hackernewsapi.git
- dotnet run --project hackernewsapi/hackernewsapi.csproj
- dotnet test
- curl GET 'http://localhost:5000/hackernews'
The default request use in memory cache to avoid get again the same stories, to disable it use: - curl GET 'http://localhost:5000/hackernews' --header 'DisableCache: true'
For cache cleaning - curl GET 'http://localhost:5000/clean'
Check the Changelog file to see how I evolved the code since the beginner, there is a few tagged version and a short description
There is a bunch of features and good practices to enhance the service, I will add them as soon as posible, the main improvement points are:
-
Global exception handler: Implement a single point of treatment for exceptions (Global Filter)
-
Input validation: Implement a single point for treat mandatory fields in the request