pambda-path

0.1.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    1
  • 0.1.0
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i pambda-path

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

3.09 kB

Total Files

3

Last publish

Collaborators

  • nak2k