From ebdada31ae9629939f83b5dad9407a8815e54a0e Mon Sep 17 00:00:00 2001 From: Nial <48334675+nmcc1212@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:30:15 +0100 Subject: [PATCH] Update backend.js and newsList.tsx to use IP address instead of localhost --- intro to react/fun-with-react/backend.js | 2 +- next/news-aggregation/src/components/newsList.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intro to react/fun-with-react/backend.js b/intro to react/fun-with-react/backend.js index 47f2803..b842520 100644 --- a/intro to react/fun-with-react/backend.js +++ b/intro to react/fun-with-react/backend.js @@ -16,7 +16,7 @@ app.post('/api/fetchNews', async (req, res) => { const rssFeedUrls = req.body.rssFeedUrls; console.log(`Fetching and parsing RSS feeds from: ${rssFeedUrls}`); const responses = await Promise.all( - rssFeedUrls.map(url => axios.get(`http://localhost:50110?feedURL=${url}`)) + rssFeedUrls.map(url => axios.get(`http://100.88.40.21:50110?feedURL=${url}`)) ); const data = await Promise.all(responses.map(response => response.data)); diff --git a/next/news-aggregation/src/components/newsList.tsx b/next/news-aggregation/src/components/newsList.tsx index 38b9a77..014e695 100644 --- a/next/news-aggregation/src/components/newsList.tsx +++ b/next/news-aggregation/src/components/newsList.tsx @@ -25,7 +25,7 @@ function NewsList(props: Readonly<{ try { setIsLoading(true); if (Array.isArray(props.rssFeedUrls)) { - const response = await axios.post('http://localhost:50111/api/fetchNews', { + const response = await axios.post('http://100.88.40.21:50111/api/fetchNews', { // const response = await axios.post('http://100.125.70.69:50111/api/fetchNews', { rssFeedUrls: props.rssFeedUrls, });