Skip to content

Commit

Permalink
chore: Redirect old weave homepage (#2060)
Browse files Browse the repository at this point in the history
* init

* init

* fixed
  • Loading branch information
tssweeney authored Sep 11, 2024
1 parent 0074a4c commit e06d90d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions weave/weave_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<path:path>")
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"):
Expand All @@ -462,6 +470,10 @@ def frontend(path):
@blueprint.route("/", defaults={"path": None})
@blueprint.route("/<path:path>")
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)
Expand Down

0 comments on commit e06d90d

Please sign in to comment.