1- import { Router } from "@funstack/router" ;
1+ import { Outlet , Router } from "@funstack/router" ;
22import { route , type RouteDefinition } from "@funstack/router/server" ;
33import { defer } from "@funstack/static/server" ;
44import { Layout } from "./components/Layout/Layout" ;
@@ -10,28 +10,34 @@ import { Home } from "./pages/Home";
1010
1111const routes : RouteDefinition [ ] = [
1212 route ( {
13- path : "/" ,
14- component : (
15- < Layout variant = "home" >
16- < Home />
17- </ Layout >
18- ) ,
19- } ) ,
20- route ( {
21- path : "/getting-started" ,
22- component : < Layout > { defer ( GettingStarted ) } </ Layout > ,
23- } ) ,
24- route ( {
25- path : "/api/funstack-static" ,
26- component : < Layout > { defer ( FunstackStaticApi ) } </ Layout > ,
27- } ) ,
28- route ( {
29- path : "/api/defer" ,
30- component : < Layout > { defer ( DeferApi ) } </ Layout > ,
31- } ) ,
32- route ( {
33- path : "/concepts/rsc" ,
34- component : < Layout > { defer ( RSCConcept ) } </ Layout > ,
13+ path : import . meta. env . BASE_URL . replace ( / \/ $ / , "" ) ,
14+ component : < Outlet /> ,
15+ children : [
16+ route ( {
17+ path : "/" ,
18+ component : (
19+ < Layout variant = "home" >
20+ < Home />
21+ </ Layout >
22+ ) ,
23+ } ) ,
24+ route ( {
25+ path : "/getting-started" ,
26+ component : < Layout > { defer ( GettingStarted ) } </ Layout > ,
27+ } ) ,
28+ route ( {
29+ path : "/api/funstack-static" ,
30+ component : < Layout > { defer ( FunstackStaticApi ) } </ Layout > ,
31+ } ) ,
32+ route ( {
33+ path : "/api/defer" ,
34+ component : < Layout > { defer ( DeferApi ) } </ Layout > ,
35+ } ) ,
36+ route ( {
37+ path : "/concepts/rsc" ,
38+ component : < Layout > { defer ( RSCConcept ) } </ Layout > ,
39+ } ) ,
40+ ] ,
3541 } ) ,
3642] ;
3743
0 commit comments