boyney123 / mockit

A tool to quickly mock out end points, setup delays and more...
https://mockit.netlify.com/
MIT License
1.58k stars 84 forks source link

All Functions not working when hosted on a server #89

Open Neillbar opened 3 years ago

Neillbar commented 3 years ago

What you did:

Hi, i am hosting this on a CentOS server, this allows me and a friend to use it. I can access it but i am unable to save any changes on the console.

What happened:

When i try to save the changes to the path, i see it tries to save too localhost. -> PUT http://localhost:4000/route where it should be saving to our server which in this case is something else.

Problem description:

I can access it, but looks like configurations are pointing to local host instead of the host where it is deployed on.

Suggested solution:

Could you please commit an update that has a fix for this ? thanks so much!

dante0747 commented 3 years ago

Hi. I know it's too late to respond. I'm just writing here for those who have faced the same issue.

You should change the following environment variables in docker-compose.yml:

REACT_APP_MOCKIT_SERVER_URL=http://localhost:3000
REACT_APP_MOCKIT_API_URL=http://localhost:4000
ONEUM commented 2 years ago

Hi there, I can confirm that this issue is still present if deployed via cloned docker-compose on host A and accessed from host B. The page gets loaded but if you try to edit existing or add new route the dialog in modal window does not close and stays permanent and nothing happens afterwards. Only thing one can do is close the modal.

ONEUM commented 2 years ago

Hi. I know it's too late to respond. I'm just writing here for those who have faced the same issue.

You should change the following environment variables in docker-compose.yml:

REACT_APP_MOCKIT_SERVER_URL=http://localhost:3000
REACT_APP_MOCKIT_API_URL=http://localhost:4000

this env vars setting is already set this way and it is not working, any hint?

rayjaymor85 commented 2 years ago

I know this post is 2 years old but I came across this exact same issue.

The advice from @dante0747 does in fact work - just replace "localhost" on these lines with your IP address if you're hosting on a lab or remote service. In my case the ip address of my docker server worked just fine (so if you access mockit on http://**10.1.1.128**:5000 then set these lines to:

REACT_APP_MOCKIT_SERVER_URL=http://10.1.1.128:3000
REACT_APP_MOCKIT_API_URL=http://10.1.1.128:4000