mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-03-01 09:50:35 +00:00
document path-based routing
This commit is contained in:
parent
927f150d4f
commit
af88d935bc
37
docs/DevOps_installation_integration/path_based_routing.md
Normal file
37
docs/DevOps_installation_integration/path_based_routing.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Path-based Routing
|
||||||
|
|
||||||
|
If you are using frontend, frontend and backend need to share cookies.
|
||||||
|
Backend, in particular, sets a cookie, and frontend needs to read it.
|
||||||
|
As such, you cannot run frontend and backend on different subdomains, like this:
|
||||||
|
|
||||||
|
* frontend.example.com
|
||||||
|
* backend.example.com
|
||||||
|
|
||||||
|
Instead, we often run them like this:
|
||||||
|
|
||||||
|
* example.com for frontend
|
||||||
|
* api.example.com for backend
|
||||||
|
|
||||||
|
This works, since backend can set a cookie for the entire domain, and frontend can read it.
|
||||||
|
|
||||||
|
Another alternative that works well is to run them on the same host, but with different paths, like this:
|
||||||
|
|
||||||
|
* spiff.example.com for frontend
|
||||||
|
* spiff.example.com/api for backend
|
||||||
|
|
||||||
|
To accomplish this path-based routing scenario, set environment variables like this in frontend:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
SPIFFWORKFLOW_FRONTEND_RUNTIME_CONFIG_APP_ROUTING_STRATEGY=path_based
|
||||||
|
```
|
||||||
|
|
||||||
|
And in backend, you may need to set:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
SPIFFWORKFLOW_BACKEND_URL_FOR_FRONTEND=https://spiff.example.com
|
||||||
|
SPIFFWORKFLOW_BACKEND_URL=https://spiff.example.com/api
|
||||||
|
# if you happen to be using the internal openid server. do not do this in production.
|
||||||
|
SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL=https://spiff.example.com/api/openid
|
||||||
|
# if you can manage, use in-cluster DNS for connector. you may need a different host or port.
|
||||||
|
SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL=http://spiffworkflow-connector:8004
|
||||||
|
```
|
@ -48,6 +48,7 @@ DevOps_installation_integration/configure_connector_proxy.md
|
|||||||
DevOps_installation_integration/deploy_aws_lambda.md
|
DevOps_installation_integration/deploy_aws_lambda.md
|
||||||
DevOps_installation_integration/Secrets.md
|
DevOps_installation_integration/Secrets.md
|
||||||
DevOps_installation_integration/redis_celery_broker.md
|
DevOps_installation_integration/redis_celery_broker.md
|
||||||
|
DevOps_installation_integration/path_based_routing.md
|
||||||
```
|
```
|
||||||
|
|
||||||
```{toctree}
|
```{toctree}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user