This commit is contained in:
Doc-T-or
2024-01-18 18:32:00 +03:00
parent 9b74f35205
commit 52af66af90
+3 -3
View File
@@ -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',
});