Challenge: Build an API to Fetch Posts
Take the coding challenge to build an API using Express.js to fetch a set of random posts and apply middleware.
We'll cover the following...
Problem statement
Below are the functions that needs to be implemented in order to finish the challenge. A code editor is provided after the problem statement to complete the coding challenge. Make sure all the points are implemented. After the coding challenge, there is a solution provided at the end.
Requirements
Implement the
fetchPosts()
function in theutils.js
file. Below are the requirements:The function will accept ...