mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-28 15:51:29 +08:00
53ca110218
Flatten the instance `runtime` object into two fields: `runtime` (the JS engine,
node | workerd) and `platform` (the deployment host). The About page shows each
as its own row with friendly labels (e.g. "workerd" + "Cloudflare Workers",
"Node.js" + "Docker").
- Detect the platform from the entry file (entry === target): each serverless
entry declares it; entry-node sniffs Cloud Run (K_SERVICE) / Docker
(ZPAN_RUNTIME, set in the Dockerfile) / bare node. Cloudflare is detected from
the D1 binding.
- Decouple the cloud payload: zpan-cloud-sdk fixes runtime { provider, target },
so CloudInstanceInfo keeps that shape and buildCloudInstanceInfo maps to it;
buildInstanceInfo serves the richer flat shape to the About API.
- Migrate PostHog instance telemetry to the runtime/platform shape and merge the
duplicate runtimeInfo in licensing-admin into the shared one.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25 lines
706 B
TypeScript
25 lines
706 B
TypeScript
import { handle } from 'hono/vercel'
|
|
import { createBootstrap } from './bootstrap'
|
|
import { createLibsqlPlatform } from './platform/libsql'
|
|
import { setDeployPlatform } from './runtime-platform'
|
|
|
|
setDeployPlatform('vercel')
|
|
|
|
const tursoUrl = process.env.TURSO_DATABASE_URL
|
|
if (!tursoUrl) {
|
|
throw new Error('TURSO_DATABASE_URL is required for Vercel deployment.')
|
|
}
|
|
|
|
const platform = await createLibsqlPlatform({
|
|
TURSO_DATABASE_URL: tursoUrl,
|
|
TURSO_AUTH_TOKEN: process.env.TURSO_AUTH_TOKEN,
|
|
})
|
|
|
|
const app = await createBootstrap(platform)
|
|
|
|
export const GET = handle(app)
|
|
export const POST = handle(app)
|
|
export const PUT = handle(app)
|
|
export const PATCH = handle(app)
|
|
export const DELETE = handle(app)
|