Storing in Array
my_posts = [
{
"title": "title of post 1",
"content": "content of post 1",
"id": 1
},
{
"title": "favorite foods",
"content": "Pizza",
"id": 2
}
]@app.get("/posts")
def get_posts():
return {"data": my_posts}
Last updated