refactor(core): minor fresh/compat cleanups (#2880)

This commit is contained in:
Asher Gomez
2025-05-19 12:05:22 +02:00
committed by GitHub
parent 8953650420
commit 144ed2e75c
4 changed files with 19 additions and 42 deletions
+6 -16
View File
@@ -1,19 +1,9 @@
import type { Handlers } from "fresh/compat";
import { define } from "../../utils/state.ts";
export const handler: Handlers<void> = {
export const handler = define.handlers({
GET(ctx) {
const slug = ctx.params.slug;
if (slug === "concepts/architechture") {
return new Response("", {
status: 307,
headers: { location: "/docs/concepts/architecture" },
});
}
return new Response("", {
status: 307,
headers: { location: "/docs/introduction" },
});
return ctx.url.pathname === "/concepts/architechture"
? ctx.redirect("/docs/concepts/architecture")
: ctx.redirect("/docs/introduction");
},
};
});