@arena-im/arena-express-middleware

    0.0.9 • Public • Published

    Arena Express Middleware

    Features

    • SEO Middleware

      Adds the appropriate SEO JSON-LD data into HTML according to the arena events embedded in the page.

    Installation

    Install using npm.

    $ npm install @arena-im/arena-express-middleware

    Usage

    Then use it in your Node.js script like this example:

    const express = require('express');
    const arenaExpressMiddleware = require('@arena-im/arena-express-middleware');
    
    const app = express();
    
    app.use("posts/*", (req, res, next) => {
      res.locals.static = __dirname + "/public/index.html";
    
      next();
    });
    
    app.use("posts/*", arenaExpressMiddleware);
    
    app.listen(8000);

    This sample demonstrates the most simplistic usage of Arena Express Middleware. It simply creates a new Express Application and in the example route posts/* it set on locals.staticthe HTML file path used to render the page. Then it calls the next()function to call the next middleware that uses the Arena Express Middleware to inject its features in the HTML.

    Install

    npm i @arena-im/arena-express-middleware

    DownloadsWeekly Downloads

    4

    Version

    0.0.9

    License

    ISC

    Unpacked Size

    4.62 kB

    Total Files

    3

    Last publish

    Collaborators

    • arturarena
    • edgard.arena
    • aleksi.arena
    • stationfynpm
    • cesar_arena
    • lucaspeixoto-arena
    • larissadornelas