WaspW
Wasp•13mo ago
sion0921

Custom Backend URL is not getting set for Client

REACT_APP_API_URL issue
I'm unable to set a custom backend domain for my webpage.

It's a Wasp issue that appears to ignore the REACT_APP_API_URL=https://api.spellfast.ai client-side variable. I've already added CERTs and DNS records for the custom BE URL.

When I deploy, I use this command:
REACT_APP_API_URL=https://api.spellfast.ai REACT_APP_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/xxxx REACT_APP_GOOGLE_ANALYTICS_ID=G-xxx REACT_APP_EXTENSION_ID=xxxx wasp deploy fly deploy 


So even if I check api url, it's https://spellfast-server.fly.dev while I need https://api.spellfast.ai
import { config } from 'wasp/client'

console.log(config.apiUrl)


Interestingly, during deployment, I inspected the logs. For some reason, the client is using the fly.io 'https://spellfast-server.fly.dev' domain instead of my custom one, during npm run build
  Server has been deployed! 
🚀  Deploying your client now... 
$ cd /home/regent116/SpellFast/spellfast/app/.wasp/build/web-app
🚀  Building web client for production... 
$ npm install
...

found 0 vulnerabilities
$ REACT_APP_API_URL=https://spellfast-server.fly.dev npm run build <-- // should be https://api.spellfast.ai


Frustration is setting in as I try to configure my backend to work with my custom domain, but I can't pinpoint my mistake.
Was this page helpful?