mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 14:22:27 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user