news list now can load local json file
This commit is contained in:
parent
5c0a5128ac
commit
14294f8a14
9 changed files with 17 additions and 3 deletions
|
@ -19,9 +19,7 @@ const NewsPage = () => {
|
|||
const fetchNews = async () => {
|
||||
try {
|
||||
console.log("Fetching news...");
|
||||
const response = await fetch(
|
||||
"https://raw.githubusercontent.com/newspedia-crew/newspedia-web/intern-change/public/data/index.json",
|
||||
);
|
||||
const response = await fetch("/api/news");
|
||||
console.log("Response status:", response.status);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue