From 932f3bbcab9be82aafb487d7890fde83b2210a7b Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Thu, 27 Jan 2022 11:57:41 -0700 Subject: Preserve redirect with `/_/` path prefix (#13) This adds a straightforward way of preserving Farside's redirecting behavior in the user's browser history. That way if an instance becomes unavailable between the 5 min scans, the user can opt to navigate back one page and be taken to a new instance. This is accomplished using a single line of JS, and could potentially work as the default behavior of Farside (with the current default behavior requiring a path prefix instead). This should be revisited down the road when more people are using this service. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 2c0bd9f..8ecd3d2 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,13 @@ Farside's routing is very minimal, with only the following routes: URL>/r/popular` - Note that a path is not required. `/libreddit` for example will still redirect the user to a working libreddit instance +- `/_/:service/*glob` + - Achieves the same redirect as the main `/:service/*glob` endpoint, but + preserves a short landing page in the browser's history to allow quickly + jumping between instances by navigating back. + - Ex: `/_/nitter` -> nitter instance A -> (navigate back one page) -> nitter + instance B -> ... + - *Note: Uses Javascript to preserve the page in history* When a service is requested with the `/:service/...` endpoint, Farside requests the list of working instances from Redis and returns a random one from the list -- cgit v1.2.3