json

2 years 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

2 years 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


2 years ago

full program attached

Attachments


2 years ago

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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...