mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-04 06:04:21 +01:00
feat: initialize repository, setup Next.js, shadcn-ui, hono, ...etc
This commit is contained in:
8
src/server/hono/app.ts
Normal file
8
src/server/hono/app.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Hono } from "hono";
|
||||
|
||||
// biome-ignore lint/complexity/noBannedTypes: add after
|
||||
export type HonoContext = {};
|
||||
|
||||
export const honoApp = new Hono<HonoContext>().basePath("/api");
|
||||
|
||||
export type HonoAppType = typeof honoApp;
|
||||
20
src/server/hono/route.ts
Normal file
20
src/server/hono/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { zValidator } from "@hono/zod-validator";
|
||||
import { z } from "zod";
|
||||
import type { HonoAppType } from "./app";
|
||||
|
||||
const helloBodySchema = z.object({
|
||||
name: z.string(),
|
||||
});
|
||||
|
||||
export const routes = (app: HonoAppType) => {
|
||||
return (
|
||||
app
|
||||
// routes
|
||||
.get("/hello", zValidator("json", helloBodySchema), (c) => {
|
||||
const { name } = c.req.valid("json");
|
||||
return c.json({ message: `Hello ${name}` });
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
export type RouteType = ReturnType<typeof routes>;
|
||||
Reference in New Issue
Block a user