From e06d90dcdc746106fd9c4b9ed9788807dd03c2a7 Mon Sep 17 00:00:00 2001 From: Tim Sweeney Date: Tue, 10 Sep 2024 23:07:57 -0700 Subject: [PATCH] chore: Redirect old weave homepage (#2060) * init * init * fixed --- weave/weave_server.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/weave/weave_server.py b/weave/weave_server.py index 05870a1ea1d..2da3e6cd542 100644 --- a/weave/weave_server.py +++ b/weave/weave_server.py @@ -441,9 +441,17 @@ def frontend_env(): } +def legacy_weave_redirect(): + return redirect("https://wandb.github.io/weave/", code=302) + + @blueprint.route("/__frontend", defaults={"path": None}) @blueprint.route("/__frontend/") def frontend(path): + # Redirect to the new docs site + if not environment.env_is_ci(): + return legacy_weave_redirect() + """Serve the frontend with a simple fileserver over HTTP.""" # We serve up a dynamic env.js file before all other js. if path is not None and path.endswith("env.js"): @@ -462,6 +470,10 @@ def frontend(path): @blueprint.route("/", defaults={"path": None}) @blueprint.route("/") def root_frontend(path): + # Redirect to the new docs site + if not environment.env_is_ci(): + return legacy_weave_redirect() + if request.args.get("unsetBetaVersion") is not None: resp = redirect_without_query_param("unsetBetaVersion") resp.set_cookie("betaVersion", "", max_age=0)