sync
parent
901172d43e
commit
aab4bbb4dc
@ -1,9 +1,11 @@
|
|||||||
import Elysia from "elysia";
|
import Elysia from "elysia";
|
||||||
import { authGroup } from "./(auth)/*";
|
import { authGroup } from "./(auth)/*";
|
||||||
import { index } from "./index";
|
import { index } from "./index";
|
||||||
|
import { user } from "./user/*";
|
||||||
|
|
||||||
export const pages = new Elysia({
|
export const pages = new Elysia({
|
||||||
name: "@pages/root",
|
name: "@pages/root",
|
||||||
})
|
})
|
||||||
.use(index)
|
.use(index)
|
||||||
.use(authGroup);
|
.use(authGroup)
|
||||||
|
.use(user);
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
import Elysia from "elysia";
|
||||||
|
import { id } from "./<id>";
|
||||||
|
|
||||||
|
export const user = new Elysia({
|
||||||
|
name: "@pages/user/*",
|
||||||
|
})
|
||||||
|
.use(id)
|
@ -0,0 +1,15 @@
|
|||||||
|
import Elysia from "elysia";
|
||||||
|
import { BaseHtml } from "../../components/base";
|
||||||
|
import { ctx } from "../../context";
|
||||||
|
|
||||||
|
export const id = new Elysia({
|
||||||
|
name: "@pages/user/[id]",
|
||||||
|
})
|
||||||
|
.use(ctx)
|
||||||
|
.get("/user/:id", async ({ html, params: { id } }) => {
|
||||||
|
return html(() => (
|
||||||
|
<BaseHtml>
|
||||||
|
<h1>hi: {id}!</h1>
|
||||||
|
</BaseHtml>
|
||||||
|
));
|
||||||
|
});
|
Loading…
Reference in New Issue