how can i set the redirection ip to something other than localhost, im running the test version on a

sfgsfhg
6 Replies
kapa.ai
kapa.ai•2w ago
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:
export REACT_APP_API_URL=<http://yourdesiredurl.com>
export REACT_APP_API_URL=<http://yourdesiredurl.com>
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?
iRazvan2745
iRazvan2745•2w ago
for the SaaS template?
Milica
Milica•2w ago
The SaaS template utilizes Wasp under the hood, so yes 🙂
miho
miho•2w ago
redirection ip to something other than localhost
Where are you redirecting to? Is this related to auth?
iRazvan2745
iRazvan2745•2w ago
yes i dont want to have it be localhost i need it to be the acutal ipv4
miho
miho•2w ago
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.
Want results from more Discord servers?
Add your server