Skip to content

Commit f468fe7

Browse files
authored
feat: redirect to https://hunt.deno.land (#305)
* feat: redirect to new host * better
1 parent 5a75926 commit f468fe7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

routes/_middleware.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import { MiddlewareHandlerContext } from "$fresh/server.ts";
33
import { walk } from "std/fs/walk.ts";
44
import { getSessionId } from "kv_oauth";
5-
import { setRedirectUrlCookie } from "@/utils/redirect.ts";
5+
import { redirect, setRedirectUrlCookie } from "@/utils/redirect.ts";
6+
import { Status } from "std/http/http_status.ts";
67

78
export interface State {
89
sessionId?: string;
@@ -18,7 +19,12 @@ export async function handler(
1819
req: Request,
1920
ctx: MiddlewareHandlerContext<State>,
2021
) {
21-
const { pathname } = new URL(req.url);
22+
const { pathname, hostname } = new URL(req.url);
23+
24+
if (hostname === "saaskit.deno.dev") {
25+
return redirect("https://hunt.deno.land", Status.Found);
26+
}
27+
2228
// Don't process session-related data for keepalive and static requests
2329
if (["_frsh", ...staticFileNames].some((part) => pathname.includes(part))) {
2430
return await ctx.next();

0 commit comments

Comments
 (0)