json

a year ago

db.json file and

{
"users": [
{
"id": "ec7f",
"name": "simon",
"email": "robel@live.com"
},
{
"id": "978f",
"name": "dynamichghgfhfg",
"email": "romaabra82@gmail.com"
},
{
"id": "9bb3",
"name": "simon",
"email": "mghezehiei@gmail.com"
},
{
"id": "f5bb",
"name": "dyhhhhh",
"email": "romaabra82@gmail.com"
}
]
}

useEffect(() => {
setLoading(true);
axios.get('http://localhost:3030/users')
.then(response => {
setData(response.data)
setUsers(response.data);
})
.finally(() => setLoading(false));
}, []);

it work fine local host when depoy is not working how to change
http://localhost:3030/users/ what is Railway http://:*/users
i need help

3 Replies

a year ago

please help how to do it
db.json file and

{
"users": [
{
"id": "ec7f",
"name": "simon",
"email": "robel@live.com"
},
{
"id": "978f",
"name": "dynamichghgfhfg",
"email": "romaabra82@gmail.com"
},
{
"id": "9bb3",
"name": "simon",
"email": "mghezehiei@gmail.com"
},
{
"id": "f5bb",
"name": "dyhhhhh",
"email": "romaabra82@gmail.com"
}
]
}

useEffect(() => {
setLoading(true);
axios.get('http://localhost:3030/users')
.then(response => {
setData(response.data)
setUsers(response.data);
})
.finally(() => setLoading(false));
}, []);

it work fine local host when depoy is not working how to change
http://localhost:3030/users/ what is Railway http://:*/users
i need help


a year ago

full program attached

Attachments


a year ago

You answered yourself.. replace 'http://localhost:3030' with 'https://[your railway domain]'