0.1.1 • Published 6 years ago

pambda-path v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

pambda-path

Installation

npm i pambda-path

Usage

const { compose, createLambda } = require('pambda');
const { path, combineByPath } = require('pambda-path');

exports.handler = createLambda(
  compose(
    path('/', next => (event, context, callback) => {
      // Render top page.
    }),
    combineByPath({
      '/foo': next => (event, context, callback) => {
        // Do something.
      }),
      '/bar': next => (event, context, callback) => {
        // Do something.
      }),
    }),
  )
);

path(path, pambda)

Generate a pambda that runs a specified pambda only if a path of an event exactly matches to a specified path.

  • path
  • pambda
    • A pambda function that is executed if a path matched.

Related

License

MIT

0.1.1

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

7 years ago