This package provides a middleware for HAL APIs.
The middleware looks for HAL and JSON responses, and automatically converts them into a HTML interface if a browser access them.
It does so via the Accept: text/html header. If this header is not provides,
the middleware does nothing.
npm install hal-browser
import { Application } from 'curveball/@core';
import halBrowser from 'hal-browser';
const app = new Application();
app.use(halBrowser({
title: 'HAL Browser',
stylesheets: [
// path to CSS stylesheets
],
});The HAL browser ships with 2 really basic stylesheets in the styles
directory:
main.css- Main interface csssolarized-dark.css- A syntax highlighting stylesheet lifted from the Highlight.js project, and originally created by (c) Jeremy Hull
For best effect you'll want both stylesheets!
TODO
TODO