flyctl status shows the server machines as started. The server app’s fly.toml has internal_port = 8080. In local dev everything works (API on http://localhost:3001/api/v1).
I need to keep a single domain (https://getfocusvault.com) and have /api/v1/* reach the server app. Right now, calls from my local machine to the API URL don’t work (HTML on the main domain, 502 on the server app URL).
Probably the problem is in fly.io networking, for server and client, because when I try to run the same project in my local pc and try to access same url api/v1/license/activate from my local pc, I can access it. Probably, the my API request goes to client, not to server, and they respond failure.
Maybe I can merger server and client machines into one? Or find an access url for my server machine with in my domain?
Are you trying to contact one machine from another in the Fly private network? If so, 127.0.0.1 won’t work - that’s localhost.
However if you’re just using 127.0.0.1 for debugging purposes in a machine console, then you need to work out if your listener is still up. What processes do you get with ps aux? What is the output of netstat -tuln?
I think it is because I have 2 apps as server and client, My API request goes to client, instead of server app probably.
When I try to run the same project in local, I can access it from my own machine since I don’t have seperate machines like client and server. It can respond to me from the localhost:3001. But when I deploy that url cannot respond my local machine. from these urls:
https://getfocusvault.com/api/v1/license/activate or https:/getfocusvault.com/api/v1/license/activate
What do you guys suggest? I would like to access my url.
Much, much, better. Please always post like that; this is well formatted, and offers plenty of clarity.
OK, so the first thing is that https://mericsfocusvault-server.fly.dev does not seem to be responding from the public internet. I would fix that first. I think this is where your API actually lives.
At a guess, the port listener configured in your fly.toml does not match up with the one that is actually in use.
I will post this, and then will make a suggestion for fixing your other problem.
Secondly, I can see that in your web app, you are making calls to two APIs:
GET https://getfocusvault.com/api/v1/license/activate
GET https://mericsfocusvault-server.fly.dev/auth/me
I suspect the first one will fail because there isn’t an API deployed there, and the second one might work, but it needs to be exposed to the public internet first. Now, you may also have CORS problems, since you are using two different domains, but they are resolvable.
As an alternative, you could set up a proxy in getfocusvault.com so that it talks to mericsfocusvault-server.fly.dev on your behalf. That would resolve CORS problems, but at the cost of more set-up work. In fact, if you take this option, you would not need to expose the API server to the internet at all, since the network connection between the two machines could just be on the Fly private network.
This Fly config looks OK. Make sure you are listening on port 8080 in that app. Also, are you attaching to IPv4 or IPv6? Also, check that you are attaching on all interfaces, and not just local. Finally, if you are still stuck, show us what flyctl ips list gives you for the API app.
I wonder if you are getting your terms mixed up. Your curl attempt indicates that you were POSTing a JSON string to this endpoint, which you would not do for a static JavaScript file. An API is basically a web server that accepts and receives JSON (or some other serialised data format).
Currently I am assuming that your API is not on https://getfocusvault.com, which I guess is why this does not work.
I wonder if this is your trouble. I assume you are running your API container locally in Docker. But your API Fly config specifies port 8080 as the listener; the port number has to match.
chatgpt 5 claims that, the issue is related with server and client duality. When I try to access that url, client responds not server, and he thinks my code lives in server In my local pc, I don’t haver server and client, only db and my wasp project..
wasp start/wasp db start, and when I try to curl that as I show you:
Start here; get your API server working. I assume it is safe to put on the web, but be aware that if you’re “vibe coding”, AI tools aren’t going to protect you from security issues.
Also, check that your configured port matches the port in your API app. I wonder if it should be 3001, not 8080: