Hi Sam, wow-backend-api.herokuapp.com/api/... is showed users data in the seed file. and localhost:3000/api/v1/players is showed the recent users data which are stored in pgAdmin.
Example: Here is my fetchPlayer.js from frontend
const apiURL = process.env.REACT_APP_BASE_API_URL export function fetchPlayers() { return (dispatch) => { fetch(${apiURL}/api/v1/players) //Inline code has back-ticks around it. .then(resp => resp.json()) .then(players => dispatch({ type: 'FETCH_PLAYERS', payload: players })) } }
${apiURL}/api/v1/players
code
back-ticks around
Thanks,
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Sam,
wow-backend-api.herokuapp.com/api/... is showed users data in the seed file.
and localhost:3000/api/v1/players is showed the recent users data which are stored in pgAdmin.
Example: Here is my fetchPlayer.js from frontend
const apiURL = process.env.REACT_APP_BASE_API_URL
export function fetchPlayers() {
return (dispatch) => {
fetch(
${apiURL}/api/v1/players
) //Inlinecode
hasback-ticks around
it..then(resp => resp.json())
.then(players => dispatch({
type: 'FETCH_PLAYERS', payload: players
}))
}
}
Thanks,