hypernova-client
A node client for sending requests to Hypernova.
class Renderer
Renderer.prototype.addPlugin
(plugin: HypernovaPlugin)
Adds a plugin to the renderer.
Renderer.prototype.render
(data: Jobs): Promise
Sends a request to Hypernova for the provided payload and returns a promise which will fulfill with the HTML string you can pass down to the client.
Example usage
const express = ;const Renderer = ;const devModePlugin = ; const app = ; const renderer = url: 'http://localhost:3030/batch' plugins: devModePlugin ; app; app;
Plugin Lifecycle API
Allows you to alter the data that a "view" will receive.
;;
A reducer type function that is called when preparing the request that will be sent to Hypernova. This function receives the current running jobs Object and the original jobs Object.
An every
type function. If one returns false
then the request is canceled.
An event type function that is called prior to a request being sent.
;;
A reducer type function which receives the current response and the original response from the Hypernova service.
;;
An event type function that is called whenever a request was successful.
;;
An event type function that is called whenever any error is encountered.