Просмотр исходного кода

updating readme to reflect how to override the base url

Signed-off-by: Logan Ballard <loganballard@gmail.com>
Logan Ballard 3 лет назад
Родитель
Сommit
f04f997eeb
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      ui/README.md

+ 8 - 0
ui/README.md

@@ -47,4 +47,12 @@ In addition, similar behavior can be replicated with the docker container:
 $ docker run -e BASE_URL_OVERRIDE=test -p 9091:9090 -d opencost-ui:latest
 $ curl localhost:9091
 <html gibberish> 
+```
+
+## Overriding the Base API URL
+
+For some use cases such as the case of [Opencost deployed behind an ingress controller](https://github.com/opencost/opencost/issues/1677), it is useful to override the `BASE_URL` variable responsible for requests sent from the UI to the API.  This means that instead of sending requests to `<domain>/model/allocation/compute/etc`, requests can be sent to `<domain>/{BASE_URL_OVERRIDE}/allocation/compute/etc`.  To do this, supply the environment variable `BASE_URL_OVERRIDE` to the docker image.
+
+```sh
+$ docker run -p 9091:9090 -e BASE_URL_OVERRIDE=anything -d opencost-ui:latest
 ```