sion0921
WWasp
•Created by sion0921 on 12/5/2024 in #🙋questions
Fly.io Multi-Region Wasp setup with database Replicas
I'm planning to run a multi-region service. My service, spellfast.ai, should be fast globally, so I'm scaling to multiple regions. The best way to do this in my case is by using database replicas, which are clones of the primary region's database. The benefit is that you have one database, and the clones receive updates. The setup involves setting up different ports for reading from database replicas and catching write requests, proxying them from replicas to the database in the primary region.
docs: https://fly.io/docs/postgres/advanced-guides/high-availability-and-global-replication/#connecting-to-read-replicas
Is such a custom setup even possible with Wasp? Any suggestions on how to achieve this?
13 replies
WWasp
•Created by sion0921 on 11/27/2024 in #🙋questions
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:
So even if I check api url, it's https://spellfast-server.fly.dev while I need https://api.spellfast.ai
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
Frustration is setting in as I try to configure my backend to work with my custom domain, but I can't pinpoint my mistake.15 replies
WWasp
•Created by sion0921 on 9/18/2024 in #🙋questions
How to generate Authorization header JWT token for custom API endpoint?
I've created operation which generates JWT token which is sent to my chrome extension.
The main goal is to access context.user for my custom API endpoint to verify if the user has a paid plan.
I've tried many combinations, using userId, username, and even config.auth.jwtSecret instead of my JWT_SECRET_KEY in env.server, but none of these work with auth:true for api endpoint in a Postman request that includes a generated bearer token.
What's the right format to sign a JWT token for it to work with a custom API endpoint to access context.user?
EDIT: I used the client-side sessionId for a custom API endpoint; however, some questions still remain
97 replies