npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@akeraio/web

v1.1.5

Published

Akera Web Handler middleware for Express.js.

Readme

Akera Logo

Web Handler Middleware for Akera Application Server.

This will serve as a proxy to one or more akera.io application server(s) by passing all incomming web requests to be handled by the corresponding broker and pipe the response back to the client.

As opposed to the @akeraio/rest that can directly run any standard procedures by passing input/output parameters, this can only execute special 'handlers' - either the 'classical' WebSpeed wrap-cgi procedures (includes wrap-cgi.i) or the new WebHandler objects (implements OpenEdge.Web.WebHandler).

Installation

$ npm install @akeraio/web

Docs

API

var akeraWeb = require('@akeraio/web')

The akeraWeb object exposes the middleware (the default function if Typescript is used) factory that can be used to create an Express middleware.

akeraWeb.middleware(configuration)

Returns an akera.io Web Handler middleware that can be used on an Express application.

config: ConnectionPoolOptions | ConnectionPool

Can be one or an array of broker configuration for remote akera.io brokers. If one configuration is used then all requests on the middleware router will be dispatched directly to that broker.

When multiple configurations are used then for each unique broker a sub-route is added to the router using the broker's alias as route and each request on the middleware requires one route parameter - the broker alias, based on which the request is dispatched to the corresponding broker. If all configurations have the same alias - fail-over configuration, then the broker will be mounted on the router's root as if a single configuration is provided.

ConnectionPool(configuration)

When both Web Handler and other Rest interfaces are to be installed for the same akera.io broker(s) then one ConnectionPool instance can be shared among them in order to use the same connections pool to the akera.io application server.

The mount method can be used on the AkeraWeb instance to retrieve the middleware router.

Errors

Broker name missing

When multiple brokers are defined each request must have one route parameter that represents the broker name (alias) to dispatch the request to.

Broker not found

When multiple brokers are defined if the broker name sent as route parameter in request is not present in configuration.

Unable to connect/All servers offline

When no connection can be established to any of the defined application server(s) for the broker.

File not found

When the requested Web Handler is not found on the akera.io application server.

Examples

Mount a single akera.io broker

A 'failsafe' configuration is defined using two akera.io application servers running on different ports on the same computer as the Express web server (localhost). All requests sent on /web path will be handled by the Web Handler middleware and will be dispatched to the first broker to which a connection can be established.

import * as express from 'express';
import { middleware, ConnectionPoolOptions } from '@akeraio/web';

let app: express.Application = express();
let connectionOptions: ConnectionPoolOptions = {
    "config": [ { "name": "demo1",
                 "host": "localhost",
                 "port": 8900 },
               { "name": "demo2",
                 "host": "localhost",
                 "port": 9900 } 
              ]
    };

app.use('/web', middleware(connectionOptions));

A request made on /web/demo/sports2000/getCustomers will run the Web Handler demo/sports2000/getCustomers on the akera.io application server.

Mount multiple akera.io brokers

A configuration is defined using two separate akera.io application servers running on different ports on the same computer as the Express web server (localhost). All requests sent on /web path will be handled by the Web Handler middleware and will be dispatched to the corresponding broker based on the broker alias (first route parameter).

import * as express from 'express';
import {AkeraWeb, ConnectionPool} from '@akeraio/web';

let app: express.Application = express();
let connectionPool: ConnectionPool = new ConnectionPool({
    "config": [ { "name": "demo1",
                 "host": "localhost",
                 "port": 8900 },
               { "name": "demo2",
                 "host": "localhost",
                 "port": 9900 } 
              ]
    });

let akeraWeb = new AkeraWeb();

app.use('/web', akeraWeb.mount(connectionPool));

A request made on /web/demo1/demo/sports2000/getCustomers will run the Web Handler demo/sports2000/getCustomers on the demo1 broker while requests made on /web/demo2/ will be dispacthed to the demo2 broker. Multiple akera.io application servers can be configured for each 'broker' - using the same alias, for failover setup.

License

Copyright (c) 2015 ACORN IT, Romania - All rights reserved

This Software is protected by copyright law and international treaties. This Software is licensed 
(not sold), and its use is subject to a valid WRITTEN AND SIGNED License Agreement. The unauthorized 
use, copying or distribution of this Software may result in severe criminal or civil penalties, and 
will be prosecuted to the maximum extent allowed by law.