fix
This commit is contained in:
@@ -11,7 +11,7 @@ function App() {
|
|||||||
|
|
||||||
const fetchNotes = async () => {
|
const fetchNotes = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('http://localhost:5000/api/notes');
|
const response = await fetch('/api/notes');
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setNotes(data);
|
setNotes(data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -22,7 +22,7 @@ function App() {
|
|||||||
const addNote = async () => {
|
const addNote = async () => {
|
||||||
if (newNote.trim() !== '') {
|
if (newNote.trim() !== '') {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('http://localhost:5000/api/notes', {
|
const response = await fetch('/api/notes', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@@ -46,7 +46,7 @@ function App() {
|
|||||||
|
|
||||||
const deleteNote = async (index) => {
|
const deleteNote = async (index) => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://localhost:5000/api/notes/${index}`, {
|
const response = await fetch(`/api/notes/${index}`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user