mgroves / realworld-aspnet-couchbase

Conduit implementation: ASP.NET Core + Couchbase
https://realworld.io
MIT License
12 stars 4 forks source link

Endpoint: List Articles #13

Open mgroves opened 1 year ago

mgroves commented 1 year ago

GET /api/articles

Returns most recent articles globally by default, provide tag, author or favorited query parameter to filter results

Query Parameters:

Filter by tag:

?tag=AngularJS

Filter by author:

?author=jake

Favorited by user:

?favorited=jake

Limit number of articles (default is 20):

?limit=20

Offset/skip number of articles (default is 0):

?offset=0

Authentication optional, will return multiple articles, ordered by most recent first

mgroves commented 1 year ago

Probably need to put a reasonable limit on limit max size, like maybe 100?

mgroves commented 1 year ago

Two possible methods:

  1. Pure SQL++: SQL query to return article info, author info, favorites, and following info
  2. SQL++ to get article IDs that match criteria, ArticleKeys ONLY, then fetch article info+author+favorites+following with existing data services

Another factor to consider: Caching! Cache results into their own document, to improve performance and reduce strain on query service? Make that a separate ticket?