NaHAL + HALDiSh plugins
Browser demo · plugins version 2.1.0
The real NaHAL HAL navigator, running in your browser with three HALDiSh plugins chained — every link you follow passes through all of them, in this order:
curie— expands a CURIE-prefixed href (api:orders.json) using the document'sCURIEcollectionbase-url-rewriter— resolves a relative href against the document's base URLlogger— records each exchange; with no filesystem in a browser it prints to the devtools console
Sample resources
Static HAL documents are served from this site. Open either build above and paste this entry point into its address bar — click it to copy:
-
api/root.jsonThe entry point — same URL for both builds.
Everything else is reached by following links from there — which is the point, since each href is written in a form that needs a plugin to become fetchable:
| Document | Href that reaches it | What resolves it |
|---|---|---|
api/orders.json |
api:orders.json |
curie expands api: → /api/, then base-url-rewriter makes it absolute |
api/customers.json |
/api/customers.json |
base-url-rewriter, against the document's base URL |
api/order-1.json |
order-1.json |
base-url-rewriter — a bare relative href |
next page of orders |
?page=2 |
base-url-rewriter — query-only hrefs are rewritten too |
| the HAL spec | https://stateless.co/… |
neither — absolute hrefs pass through untouched |
The fixtures are same-origin on purpose. A browser page cannot fetch a third-party HAL API
unless that API sends Access-Control-Allow-Origin for this origin, and no plugin
can work around it from the client side. To point the UI at your own HAL server, serve these
bundles from the same origin as the API — or run them over http://localhost.