You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tech-Lab-On-Campus/NewsFeed/docs/backend.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,10 @@
3
3
You are tasked to get news articles from Redis Cache. You will be implementing two functions in order to display them on the News Feed Website. Do not worry about reading in the data from Redis; this is done for you in `backend/app/utils/redis.py`.
4
4
5
5
## Hints:
6
-
***Hint 1:** There is only one function from `backend/app/utils/redis.py` you will need to fetch articles.
6
+
***Hint 1:** There is only one function from `backend/app/utils/redis.py` you will need to fetch articles. It can return any object you store in redis and take any shape you like.
7
7
***Hint 2:** In order to get the articles, look at how the data is written into Redis in `backend/app/__init__.py`.
8
8
***Hint 3**: You can test the backend / API changes without the frontend code! Run `localhost:8000/{endpoint}`.
9
+
-**Hint 4:** The relevant resources can be found from [resources](./resources/overview.md).
9
10
10
11
## Part 1: Write a function to Format Data
11
12
In `backend/app/newsfeed.py`, implement a private method that can format the data into an article object. Check a json file in `backend/app/resources/dataset/news` to retrieve necessary information to create an article object.
0 commit comments