Refactor app context system to use Zod schemas and sync access pattern

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
Dax Raad
2025-06-03 11:59:03 -04:00
parent 8487346d3f
commit bfb36a8566
12 changed files with 114 additions and 36 deletions

View File

@@ -15,7 +15,7 @@ export namespace Server {
const log = Log.create({ service: "server" })
const PORT = 16713
export type App = ReturnType<typeof app>
export type Routes = ReturnType<typeof app>
function app() {
const app = new Hono()
@@ -74,6 +74,25 @@ export namespace Server {
})
},
)
.post(
"/app_info",
describeRoute({
description: "Get app info",
responses: {
200: {
description: "200",
content: {
"application/json": {
schema: resolver(App.Info),
},
},
},
},
}),
async (c) => {
return c.json(App.info())
},
)
.post(
"/path_get",
describeRoute({
@@ -97,7 +116,7 @@ export namespace Server {
},
}),
async (c) => {
const app = await App.use()
const app = App.info()
return c.json({
root: app.path.root,
data: app.path.data,