From d241764c7ec6fc8badc9e7ced413e62739ab9e56 Mon Sep 17 00:00:00 2001 From: Mai Ahmed Hussein <77025553+MaiAhmedHussein@users.noreply.github.com> Date: Wed, 10 Aug 2022 19:28:51 +0200 Subject: [PATCH] Update the bored API URL -The Error: FetchError: request to https://www.boredapi.com/api/activity failed, reason: certificate has expired -What to Change: https ---> http --- services/requests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/requests.js b/services/requests.js index aabf451..b13c491 100644 --- a/services/requests.js +++ b/services/requests.js @@ -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 @@ -51,4 +51,4 @@ const deleteAllActivites = (req, res) => { .catch(err => console.log(err)); } -module.exports = { getSingleActivity, addActivityToDB, getAllActivities, deleteAllActivites } \ No newline at end of file +module.exports = { getSingleActivity, addActivityToDB, getAllActivities, deleteAllActivites }