Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions services/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getAllActivities = (req, res) => {
}

const getSingleActivity = (req, res) => {
fetch('https://www.boredapi.com/api/activity') // fetch activity from bored API - https://www.boredapi.com/about
fetch('http://www.boredapi.com/api/activity') // fetch activity from bored API - https://www.boredapi.com/about
.then(data => data.json()) // return a promise containing the response
.then(json => res.json(json)) // extract the JSON body content from the response (specifically the activity value) and sends it to the client
.catch((err) => console.log(err)) // log errors to the console
Expand All @@ -51,4 +51,4 @@ const deleteAllActivites = (req, res) => {
.catch(err => console.log(err));
}

module.exports = { getSingleActivity, addActivityToDB, getAllActivities, deleteAllActivites }
module.exports = { getSingleActivity, addActivityToDB, getAllActivities, deleteAllActivites }