添加内部 API 路由
io.github.TriliumNext/Trilium/adding-internal-api-route
在 Trilium 中新增、移动或接入内部 REST 端点(新的 /api/* 路由)时使用:在核心共享处理器(packages/trilium-core/src/routes/index.ts 的 buildSharedApiRoutes,约 140 条同时运行于 standalone sqlite-wasm 构建的路由)与仅服务端路由(apps/server/src/routes/routes.ts)之间做选择,挑选 apiRoute/asyncApiRoute 或 route/asyncRoute 包装器,并落实隐式返回约定(对象→200、undefined→204、[status, body] 元组→对应状态)与 convertEntitiesToPojo 较窄的实体解包逻辑。多数路由属于核心共享(在 WASM 下运行),apps/server/src/routes/api/ 只是少数。配合 writing-unit-tests 编写跨运行时的 CoreApiTester 测试。