how can i set the redirection ip to something other than localhost, im running the test version on a
sfgsfhg
6 Replies
Hi @iRazvan2745. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To set the redirection IP to something other than localhost, you can use environment variables. For example, you can set the
REACT_APP_API_URL
environment variable to the desired base URL. This is the URL your backend server will use.
Here's an example of how you can set it:
Please replace <http://yourdesiredurl.com
> with your actual desired URL.
Remember, the URL must be valid and absolute. If it's not, you should see an error and a warning message.
For more details, you can refer to this Github Issue (https://github.com/wasp-lang/wasp/issues/756).
If you're using social authentication like Google OAuth or Keycloak, you'll need to set the valid redirect URIs in the respective service's settings. For example, in Keycloak, you would add your new URL (replacing localhost:3001
with your new IP or URL) under "Valid Redirect URIs". You can find more information on this in the Wasp documentation (https://wasp-lang.dev/docs/auth/social-auth/keycloak#3-creating-a-keycloak-client).
If you're trying to share your app with someone else using a service like ngrok, you might need to set up forwarding for both the client and the server, and then set REACT_APP_API_URL
to the forwarded server address. You can find more information on this in this Discord thread (https://discord.com/channels/686873244791210014/1218081390176763914).
Please note that these instructions are based on the information available in the provided knowledge sources and may not cover all possible scenarios or requirements. Always refer to the official Wasp documentation or community for the most accurate and up-to-date information.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @iRazvan2745, 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?for the SaaS template?
The SaaS template utilizes Wasp under the hood, so yes 🙂
redirection ip to something other than localhostWhere are you redirecting to? Is this related to auth?
yes
i dont want to have it be localhost i need it to be the acutal ipv4
You can defined env vars for the client and server to change the behaviour of Wasp: https://wasp-lang.dev/docs/project/env-vars#client-env-vars
WASP_SERVER_URL
server env var can be something other than localhost:3001
WASP_WEB_CLIENT_URL
server env var can be something other then localhost:3000
REACT_APP_API_URL
client env var be something other than localhost:3000
Env Variables | Wasp
Environment variables are used to configure projects based on the context in which they run. This allows them to exhibit different behaviors in different environments, such as development, staging, or production.