Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

komposa

middleware composer (or 'manager'?) or some shit??... there's one single source of truth, so it's easy to debug when working with middlewares (i think)

usage

const komposa = require('komposa');
const express = require('express');

const app = express();

...

komposa({
  app,
  baseUrl: '/',
  rootMiddleWares: [
    morgan('tiny'),
    bodyParser.urlencoded({ extended: true }),
    (q, s, n) => { debug('first middle:::'); n(); },
    express.static(path.join(__dirname, 'public')),
    ['/css', express.static(path.join(__dirname, 'node_modules/bootstrap/dist/css'))],
    ['/teaspoon/', (q, s, n) => { debug('second middle:::'); n(); }],
    [['/teaspoon/', '/teapot'], (q, s, n) => { debug('second middle:::'); n(); }],
  ],
  auth: {
    middleware: authenticate,
    paths: ['/auth/teapot']
  }
});

About

middleware composer/manager???

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages