siren-meddleware

1.0.0 • Public • Published

siren-meddleware

middleware configurator for koa.

Note: This isn't like meddleware, which will return middleware. siren-meddleware carries application and config as arguments and returns the koa APPLICATION.

======= Build Status

Usage

var koa = require('koa');
var meddleware = require('meddleware');
var config = require('shush')('./config/middleware');

var app = koa();
meddleware(app, config);
app.listen(3000);

Configuration

Even though the configuration is almost the same as meddleware, many koa middleware need to take application as an argument. To make application injection available, the placeholder '__app' is supported:

{
    "middlewareA": {
        "enabled": true,
        "module": {
            "name": "koa-router",
            "arguments": [
                "__app",
                {
                    "strict": true
                }
            ]
        }
    }
}

Options, App Events and Middleware Flow Control

Please refer to meddleware, except the app is a koa application.

Tests

$ npm test

Coverage

$ npm test-cov
```

Readme

Keywords

Package Sidebar

Install

npm i siren-meddleware

Weekly Downloads

0

Version

1.0.0

License

none

Last publish

Collaborators

  • texvnars