mirror of
https://github.com/zap-proto/zip.git
synced 2026-10-19 15:38:57 +00:00
zip is shared protocol infra (the fiber-over-ZAP web framework used by every
Lux/Hanzo/Zoo Go binary — nodes, gateway, cloud, iam, kms, o11y, ai, …), so its
home is the ZAP protocol family (zap-proto/{go,http,zapd,zip}), NOT any one org's
brand namespace. This consolidates the rich framework (formerly hanzoai/zip v0.5.0
— Ctx/Handler/Errorf/Err*/HTTPError, typed handlers, middleware, runtime/extension
loading, openapi, validate, zaprpc) with the real ZAP transport (ListenZAP/
ListenHTTP/Serve over zap-proto/http) into ONE canonical module.
Module path github.com/hanzoai/zip -> github.com/zap-proto/zip. Code identical to
hanzoai/zip v0.5.0; promoted to v1.0.0 as the stable shared-infra framework. The
prior hanzoai/zip lineage is retired — one home, one import path, one way.
Verified: go build/vet/test ./... green; the ZAP round-trip integration test serves
/v1/health over the real ZAP transport (200 + handler JSON).
15 lines
545 B
TypeScript
15 lines
545 B
TypeScript
// app.ts — a legacy Express-shaped handler. Source is TypeScript; at
|
|
// startup main.go runs it through esbuild (target ES2015) and drops the
|
|
// result into zip's embedded goja VM, where JSHandler invokes it with an
|
|
// Express-shaped (req, res) pair on every request.
|
|
//
|
|
// This is the proof point of zip's TS migration path: real TS source,
|
|
// real esbuild, real goja, real Fiber, real HTTP — no rewrite required.
|
|
module.exports = function (req: any, res: any) {
|
|
res.json({
|
|
ok: true,
|
|
path: req.path,
|
|
body: req.body,
|
|
});
|
|
};
|