🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

hal-browser

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hal-browser

A HAL browser middleware

0.0.2
Source
npm
Version published
Maintainers
1
Created
Source

HAL browser

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.

Supported frameworks

  • Curveball - DONE
  • Express - TODO
  • Koa - TODO

Installation

npm install hal-browser

Getting started

Curveball

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 css
  • solarized-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!

Express

TODO

Koa

TODO

API

Keywords

hal

FAQs

Package last updated on 02 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts