Express Middleware for Ableron Server Side UI Composition
npm i @ableron/express
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 options see @ableron/ableron
All contributions are greatly appreciated, be it pull requests, feature requests or bug reports. See ableron.github.io for details.
Licensed under MIT.