@ableron/express
v1.5.1
Published
Express Middleware for Ableron Server Side UI Composition
Downloads
2,239
Maintainers
Readme
@ableron/express
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