You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when I import it and try to use it I get:
Could not proxy request /manager/personnel/ from localhost:3000 to http://127.0.0.1:5000.
I understand why this is happening but I don't know how to do it correctly. In the login component, I have this axios post request
axios.post('/login', {
email: email,
password: password,
})
And that seems to work as it is within the login component. How do I go about indicating the correct API endpoints using loaders and axios? Also, what are the advantages of using loaders compared to useEffect? Thanks in advance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
I'm using loaders to fetch data from my API (my backend is in Flask). This is a loader I'm defining in a file where I mean to have all the loaders:
However, when I import it and try to use it I get:
Could not proxy request /manager/personnel/ from localhost:3000 to http://127.0.0.1:5000.
I understand why this is happening but I don't know how to do it correctly. In the login component, I have this axios post request
axios.post('/login', {
email: email,
password: password,
})
And that seems to work as it is within the login component. How do I go about indicating the correct API endpoints using loaders and axios? Also, what are the advantages of using loaders compared to useEffect? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions