node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

siren-meddleware

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
```