From 52af66af90c8258a5043594a8560978f01272bdf Mon Sep 17 00:00:00 2001 From: Doc-T-or Date: Thu, 18 Jan 2024 18:32:00 +0300 Subject: [PATCH] fix --- notes-app/src/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notes-app/src/App.js b/notes-app/src/App.js index e3e7bc0..9fa7911 100644 --- a/notes-app/src/App.js +++ b/notes-app/src/App.js @@ -11,7 +11,7 @@ function App() { const fetchNotes = async () => { try { - const response = await fetch('http://localhost:5000/api/notes'); + const response = await fetch('/api/notes'); const data = await response.json(); setNotes(data); } catch (error) { @@ -22,7 +22,7 @@ function App() { const addNote = async () => { if (newNote.trim() !== '') { try { - const response = await fetch('http://localhost:5000/api/notes', { + const response = await fetch('/api/notes', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -46,7 +46,7 @@ function App() { const deleteNote = async (index) => { try { - const response = await fetch(`http://localhost:5000/api/notes/${index}`, { + const response = await fetch(`/api/notes/${index}`, { method: 'DELETE', });