feat: add conditional redirects when accept header contains text/html

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Muspi Merol
2025-09-12 08:57:34 +08:00
parent 58f6e0a213
commit 99ecd7b494
3 changed files with 12 additions and 0 deletions

2
netlify.toml Normal file
View File

@@ -0,0 +1,2 @@
[build]
edge_functions = "src/netlify/edge-functions"

View File

@@ -66,6 +66,7 @@
},
"devDependencies": {
"@antfu/eslint-config": "^5.3.0",
"@netlify/edge-functions": "^2.17.4",
"@types/emscripten": "^1.41.1",
"@types/mdast": "^4.0.4",
"@types/node": "^24.3.1",

View File

@@ -0,0 +1,9 @@
import type { Config } from "@netlify/edge-functions";
export default async () => Response.redirect("/hmr/llms", 302);
export const config: Config = {
path: "/hmr/llms*",
excludedPath: "/hmr/llms",
header: { accept: "text/html" },
};