Skip to content

Commit af42bbd

Browse files
committed
docs: add /guides/.../welcome route redirect → /quick-start
1 parent 5c79f52 commit af42bbd

File tree

1 file changed

+37
-0
lines changed
  • src/routes/guides/tutorials/getting-started-with-solid

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { onMount } from "solid-js";
2+
3+
/**
4+
* Server redirect. Immediate HTTP redirect for requests handled on the server.
5+
* 301 for permanent. 301s may be cached by browsers/CDNs.
6+
*/
7+
export function GET() {
8+
return new Response(null, {
9+
status: 302,
10+
headers: { Location: "/quick-start" },
11+
});
12+
}
13+
/**
14+
* Client fallback: for environments where GET isn't invoked the client will
15+
* execute this and replace the location. Keeps UX smooth when navigating client-side.
16+
*/
17+
export default function WelcomeRedirect() {
18+
onMount(() => {
19+
// use replace so the redirect doesn't add an extra history entry
20+
try {
21+
window.location.replace("https://docs.solidjs.com/quick-start");
22+
} catch (e) {
23+
// fallback: set href
24+
window.location.href = "https://docs.solidjs.com/quick-start";
25+
}
26+
});
27+
28+
return (
29+
<main style={{ "font-family": "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", padding: "2rem" }}>
30+
<h1>Redirecting…</h1>
31+
<p>
32+
You are being redirected to the Quick Start page. If the redirect does not happen automatically,{" "}
33+
<a href="https://docs.solidjs.com/quick-start">click here to continue</a>.
34+
</p>
35+
</main>
36+
);
37+
}

0 commit comments

Comments
 (0)