/ableron-express

Express Middleware for Ableron Server Side UI Composition

Primary LanguageTypeScriptMIT LicenseMIT

@ableron/express

Build Status npm version Node.js Version

Express Middleware for Ableron Server Side UI Composition

Installation

npm i @ableron/express

Usage

Full example using ES Modules

import express from 'express';
import ableron from '@ableron/express';

const app = express();

app.use(
  ableron(
    // custom settings (optional)
    {
      fragmentRequestTimeoutMillis: 5000,
      fragmentAdditionalRequestHeadersToPass: ['X-Test-Groups'],
      cacheVaryByRequestHeaders: ['X-Test-Groups'],
      statsAppendToContent: true
      // ...
    },
    // custom logger (optional). If no logger is provided, no logging happens at all
    yourLogger() || console
  )
);

Minimal example using CommonJS

const express = require('express');
const ableron = require('@ableron/express').default;

const app = express();

app.use(ableron());

Configuration

Configuration options see @ableron/ableron

Contributing

All contributions are greatly appreciated, be it pull requests, feature requests or bug reports. See ableron.github.io for details.

License

Licensed under MIT.