Hi there,
I have made a function (Serverless Functions (API Endpoints) | RedwoodJS Docs) wich acts as a download proxy for certain situations. to access it I need to get the api url from the client. how do i get this? I hoped I can find it under process.env.API_URL since it is in the redwood.toml like this. but… its not.
looking at Environment Variables | RedwoodJS Docs
i learn that i should get it via : ${global.RWJS_API_URL}
but it only shows the path, not the full address with host. (in my case in development it returns /.redwood/functions
, which is correct, but missing the host)
my redwood.toml looks like this:
[web]
bundler = "vite"
host = "0.0.0.0"
title = "domain.abc
port = 8910
# for using env variables in toml see: https://docs.redwoodjs.com/docs/app-configuration-redwood-toml/#using-environment-variables-in-redwoodtoml
# this uses "/.redwood/functions as default, and if available API_URL from environment
apiUrl = "${API_URL:/.redwood/functions}"
# you can customise graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
includeEnvironmentVariables = ["API_URL","........."] # any ENV vars that should be available to the web side, see https://redwoodjs.com/docs/environment-variables#web
[api]
host = "0.0.0.0"
port = 8911
how do i get the full api url?
thanks a lot!