-
Notifications
You must be signed in to change notification settings - Fork 57
Clarify backend root URL requirements #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,30 @@ The Main tenants are: | |||||
|
|
||||||
| 4. **Adding Authentication (optional)** : If your backend requires authentication we offer the ability to set a query param or header when you connect to it through OpenBB Pro. These values are sent on every request when configured. If you require another method - please reach out to us. | ||||||
|
|
||||||
| ## Backend URL requirements | ||||||
|
|
||||||
| When you add a backend in OpenBB Workspace, use the root base URL for that backend. | ||||||
|
|
||||||
| - Expected: `http://192.168.1.100:7777` | ||||||
| - Expected: `https://vstocks.example.com` | ||||||
| - Not supported as the backend base URL: `https://example.com/vstock` | ||||||
|
|
||||||
| OpenBB Workspace expects to find `widgets.json` at: | ||||||
|
|
||||||
| ```text | ||||||
| <base-url>/widgets.json | ||||||
| ``` | ||||||
|
|
||||||
| That means the backend configuration must be served from the root of the backend base URL. | ||||||
|
|
||||||
| If you are deploying on another machine in your LAN, make sure your app is listening on all interfaces, for example: | ||||||
|
|
||||||
| ```bash | ||||||
| uvicorn main:app --host 0.0.0.0 --port 7777 | ||||||
| ``` | ||||||
|
|
||||||
| If you need to serve additional application routes under a prefix such as `/vstock`, keep `widgets.json` at the backend root and put the rest of your routes behind the prefix. If your deployment requires a path prefix for the entire backend, use a dedicated host or subdomain instead of a subpath. | ||||||
|
||||||
| If you need to serve additional application routes under a prefix such as `/vstock`, keep `widgets.json` at the backend root and put the rest of your routes behind the prefix. If your deployment requires a path prefix for the entire backend, use a dedicated host or subdomain instead of a subpath. | |
| If you need to serve additional application routes under a prefix such as `/vstock`, keep `widgets.json` at the backend root and put the rest of your routes behind the prefix. In that setup, the widget `endpoint` values in `widgets.json` must also include the prefix (for example, `vstock/...`) so OpenBB Workspace calls the correct URLs. If your deployment requires a path prefix for the entire backend, use a dedicated host or subdomain instead of a subpath. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,6 +18,19 @@ uvicorn main:app --reload --host 0.0.0.0 --port 7779 | |||||
|
|
||||||
| The application will be available at `http://localhost:7779` | ||||||
|
|
||||||
| ## Connecting from OpenBB Workspace | ||||||
|
|
||||||
| Use the backend root URL when connecting this app to OpenBB Workspace. | ||||||
|
|
||||||
| - Works: `http://localhost:7779` | ||||||
| - Works: `http://192.168.1.100:7779` | ||||||
| - Works: `https://vstocks.example.com` | ||||||
| - Not supported as the backend base URL: `https://example.com/vstock` | ||||||
|
|
||||||
| OpenBB Workspace expects `widgets.json` to be available at `<base-url>/widgets.json`. | ||||||
|
|
||||||
| If you need to expose other endpoints under a prefix, keep `widgets.json` at the root and mount your application routes separately. For LAN deployments, run uvicorn with `--host 0.0.0.0` so the backend is reachable from other machines. | ||||||
|
||||||
| If you need to expose other endpoints under a prefix, keep `widgets.json` at the root and mount your application routes separately. For LAN deployments, run uvicorn with `--host 0.0.0.0` so the backend is reachable from other machines. | |
| If you need to expose other endpoints under a prefix, keep `widgets.json` at the root and mount your application routes separately. In that setup, the `endpoint` fields in `widgets.json` must include the same prefix (for example, `/api/widget-name` rather than `/widget-name`), because Workspace builds request URLs from the base URL plus each widget `endpoint`. For LAN deployments, run uvicorn with `--host 0.0.0.0` so the backend is reachable from other machines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence "the backend configuration must be served from the root" is ambiguous and can be read as requiring all backend routes to be rooted at , which conflicts with the next paragraph that allows prefixed routes. Consider rephrasing to explicitly state that only
widgets.jsonmust be available at<base-url>/widgets.json(and that other endpoints may live under a prefix).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apps.json / widgets.json - any config really - we dont want to say just widgets.json