Serverpod Webserver URL

32 Views Asked by At

Question regarding the Webserver (I know in beta)

Situation: I want to access a static asset (e.g. an image) on the webserver static part from within flutter. Quite a common scenario i guess.

Problem: How do I construct the URL?
More precise: how do I get the host URL (different in development, staging, production)

I know the server holds the info in the /config/{env}.yaml But how do those info travel through the serverpod_client(?) into flutter?

Was not able to find anything in the docs.
There is the serverpod_client.host property but that points (obviously) to the "api" host NOT the webserver, and they might be very differnt. e.g. api.myapp.com vs www.myapp.com

1

There are 1 best solutions below

0
On

Currently not handled automatically, you will have to set this up yourself.

This can easily be done by using flavors of the app.

Where you setup one flavor for production, one for staging, etc.