From aec7ff9da8efb1bacd1c69cedd0fae6e7b6dba4d Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Sun, 18 May 2025 12:54:46 -0400 Subject: [PATCH] better landing page when running openbb-api (#7125) Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> --- .../assets/landing_page.html | 116 ++++++++++++++++++ .../platform_api/openbb_platform_api/main.py | 14 +-- 2 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 openbb_platform/extensions/platform_api/openbb_platform_api/assets/landing_page.html diff --git a/openbb_platform/extensions/platform_api/openbb_platform_api/assets/landing_page.html b/openbb_platform/extensions/platform_api/openbb_platform_api/assets/landing_page.html new file mode 100644 index 00000000000..3054244a08e --- /dev/null +++ b/openbb_platform/extensions/platform_api/openbb_platform_api/assets/landing_page.html @@ -0,0 +1,116 @@ + + + + + + + + OpenBB Platform + + + + + +
+ +
+ +
+
+
+

+ OpenBB Platform +

+

+ The first open source financial platform. Access equity, options, crypto, forex, macro economy, fixed income, and more through a unified platform with powerful extensions. +

+ + +
+
+
+ + +
+
+
+

Connect to the OpenBB Workspace

+

+ Connect your OpenBB Platform backend with OpenBB Workspace to access all your data in an enterprise UI built for AI workflows. +

+
+ OpenBB Platform +
+
+
+

Steps to Integrate with OpenBB Workspace

+ +
    +
  1. Sign in to OpenBB Workspace
  2. +
  3. Navigate to the "Apps" tab
  4. +
  5. Click on "Connect backend"
  6. +
  7. Fill in the form with: +
      +
    • Name: OpenBB Platform
    • +
    • URL: http://127.0.0.1:6900
    • +
    +
  8. +
  9. Click on "Test" - You should see "Test successful" with the number of apps found
  10. +
  11. Click on "Add" to complete the integration
  12. +
+ +
+ Integration Guide Screenshot +
+ +
+

+ For more detailed information about integrating OpenBB Platform with OpenBB Workspace, including advanced configuration options and troubleshooting, visit our + + comprehensive integration guide + . +

+
+
+
+
+
+
+
+ + + +
+ + + \ No newline at end of file diff --git a/openbb_platform/extensions/platform_api/openbb_platform_api/main.py b/openbb_platform/extensions/platform_api/openbb_platform_api/main.py index 974d64bab95..9b03d2db6a9 100644 --- a/openbb_platform/extensions/platform_api/openbb_platform_api/main.py +++ b/openbb_platform/extensions/platform_api/openbb_platform_api/main.py @@ -10,7 +10,7 @@ import sys from pathlib import Path import uvicorn -from fastapi.responses import JSONResponse +from fastapi.responses import HTMLResponse, JSONResponse from openbb_core.api.rest_api import app from openbb_core.app.service.system_service import SystemService from openbb_core.env import Env @@ -113,12 +113,12 @@ TEMPLATES_PATH = ( @app.get("/") -async def get_root(): - """Root response and welcome message.""" - return JSONResponse( - content="Welcome to the OpenBB Platform API and Custom Workspace Backend." - + " Learn how to connect to the OpenBB Workspace here: https://docs.openbb.co/pro/custom-backend," - ) +async def root(): + """Serve the landing page HTML content.""" + html_path = Path(__file__).parent / "assets" / "landing_page.html" + with open(html_path) as f: + html_content = f.read() + return HTMLResponse(content=html_content) @app.get("/widgets.json")