class navigation
a link
class post-container
id individual-post-title
id individual-post-date
id individual-post-content
TODO API (Together): Set Up a NodeJS Server
TODO API: Create an API Endpoint to return list of posts
Endpoint: /api/posts Method: GET
[{
"id": "1581461442206",
"title": "This is a New Blog Post",
"content": "This is the content! ",
"post_image": "uploads/post-image-1581461442199.jpg",
"added_date": "1581461442206"
}]
TODO API (Together): Create post.js for interacting with data.json
TODO API: Create readData function to get data from data.json
TODO API(Together): Create storeData function to store data into data.json together with add() function
TODO API : Create an API Endpoint to return one post based on id
Endpoint: /api/posts/:post_id Method: GET
HINT: Use post.js for getting data from data.json
TODO(Together): Complete index.js to connect to API and get list of posts
HINT Make sure to make the statis files public
TODO: Complete post.js to get data from API and fill in the post.html
HINT(Together): Think about how you are going to link from index to post.html
TODO API: Create API endpoint for adding a new post without image upload
Following the code from this repository, I wasn't able to load the posts from the json file onto 'My Blog' webpage. I've mentioned the error that I'm getting below(the line numbers correspond to your code in index.js file). There is no error found in the 'Network' tab of inspect. Please help me debug this, I'd highly appreciate it!!
Error: Uncaught (in promise) TypeError: blogPosts is not iterable
at buildPosts (index.js:22)
at index.js:16