how do i change fly server endpoint
I had an endpoint for my fly server which was api.domain.xx but nonw i do not have that domain anymore so i deleted it, how do i move the app back to the fly.dev endpoint
3 Replies
Hi @Sven. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
You don’t need to “move back” the app itself – it’s already available on its original
*.fly.dev URL. What changed is just your custom domain and (likely) some env vars.
Given the docs and issues, here’s what you should check/fix:
1. Use the original Fly server URL again
Your server app on Fly will still have a URL like:
That’s the default endpoint created by wasp deploy fly setup / Fly itself and doesn’t go away when you remove a custom domain.[deploy cli]
2. Update WASP_SERVER_URL on the server
If you previously set WASP_SERVER_URL=<https://api.domain.xx,> you now need to point it back to the Fly URL so auth redirects and other logic use the correct endpoint.[env vars]
(Replace <your-server-app-name> with the actual Fly server app name.)
3. Update client-side config if needed
If your client was built to call <https://api.domain.xx,> redeploy it so it points to the *.fly.dev server URL (for Wasp’s CLI deployment this is derived from the Fly server app name by default). [server URL reset]
4. Redeploy with Wasp
After adjusting secrets, push the changes:
[deploy cmd]
If something still tries to hit the old domain, it’s almost always either WASP_SERVER_URL on the server or whatever base URL your client was built with.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?What i did now:
Remove the domain from my server in fly dashboard.
ran:
then i did:
and ran npm run deploy
what am i doing wrong? because when i go to the site it gives 401 at the requests to the server which is the fly.dev server domain.
Make sure you set all the env variables correctly
WASP_WEB_CLIENT_URL and WASP_SERVER_URL
401 means you are not logged in for some reason, maybe your application code has some logic that checks the logged in user