# bragg-route-invoke

> Invoke bragg routes in a lambda function

Latest version **2.1.0** (published 2020-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install bragg-route-invoke
pnpm add bragg-route-invoke
yarn add bragg-route-invoke
bun add bragg-route-invoke
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2020-08-17 |
| First published | 2016-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sam Verschueren |
| Maintainers | samverschueren |
| Keywords | bragg, route, router, invoke, aws, lambda |

## Links

- npm: https://www.npmjs.com/package/bragg-route-invoke
- Repository: https://github.com/SamVerschueren/bragg-route-invoke
- Homepage: https://github.com/SamVerschueren/bragg-route-invoke#readme
- Issues: https://github.com/SamVerschueren/bragg-route-invoke/issues
- npm.io page: https://npm.io/package/bragg-route-invoke

## Dependencies (1)

- [aws-lambda-invoke](https://npm.io/package/aws-lambda-invoke.md) ^3.0.0

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2020-08-17
- 2.0.0 — 2017-05-03
- 1.1.0 — 2016-10-07
- 1.0.2 — 2016-04-27
- 1.0.1 — 2016-04-27
- 1.0.0 — 2016-04-27
- 0.3.0 — 2016-04-04
- 0.2.0 — 2016-02-12
- 0.1.0 — 2016-01-19

## README

# bragg-route-invoke [![Build Status](https://travis-ci.org/SamVerschueren/bragg-route-invoke.svg?branch=master)](https://travis-ci.org/SamVerschueren/bragg-route-invoke)

> Invoke [bragg routes](https://github.com/SamVerschueren/bragg-router) in a lambda function.


## Install

```
$ npm install --save bragg-route-invoke
```


## Usage

```js
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](https://github.com/SamVerschueren/bragg-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

- [aws-lambda-invoke](https://github.com/SamVerschueren/aws-lambda-invoke) - API for this module.


## License

MIT © [Sam Verschueren](https://github.com/SamVerschueren)

---
_Source: https://npm.io/package/bragg-route-invoke · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
