2.1.0 • Published 4 years ago

bragg-route-invoke v2.1.0

Weekly downloads
1,209
License
MIT
Repository
github
Last release
4 years ago

bragg-route-invoke Build Status

Invoke bragg routes in a lambda function.

Install

$ npm install --save bragg-route-invoke

Usage

const invoke = require('bragg-route-invoke');

invoke.get('myFunction', '/foo/{bar}', {params: {bar: 'bar'}}).then(result => {
	// handle result
});

invoke.post('myFunction', '/foo', {body: {foo: 'bar'}}).then(() => {
	// resource created
});

invoke.postAsync('myFunction', '/foo', {body: {foo: 'bar'}}).then(() => {
	// don't wait for the target function to be executed
});

API

invoke.get(fn, path, options)

invoke.put(fn, path, options)

invoke.putAsync(fn, path, options)

invoke.patch(fn, path, options)

invoke.patchAsync(fn, path, options)

invoke.post(fn, path, options)

invoke.postAsync(fn, path, options)

invoke.delete(fn, path, options)

invoke.deleteAsync(fn, path, options)

fn

Type: string

Lambda function name that should be invoked.

path

Type: string

Resource path of the function defined by the router.

options

body

Type: object

Body of the request.

params

Type: object

Params of the request.

query

Type: object

Query string of the request.

identity

Type: object

Identity of the request.

Related

License

MIT © Sam Verschueren

2.1.0

4 years ago

2.0.0

7 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago