@threevl/hpo-middleware
v0.0.4
Published
Web Fetch Request/Response handler for the Human Phenotype Ontology REST API
Readme
@threevl/hpo-middleware
Framework-agnostic HPO REST API as a Web Request → Response handler (Node 18+ / WinterTCG-style).
Use @threevl/hpo-express for an Express Router, or call createHpoFetchHandler directly from Fastify, Hono, node:http, etc.
API
createHpoFetchHandler({ ontology, basePath?, includeHealth? })— returns(request: Request) => Promise<Response>.buildHpoOpenApiSpec(pathPrefix)— OpenAPI 3.1 document; paths are${pathPrefix}/ontology, etc.hpoOpenApiSpec— same asbuildHpoOpenApiSpec("/api")for the common mount layout.
basePath is the URL pathname prefix stripped before routing (e.g. "/api" when the app serves HPO under /api/*).
