# kabuki-http-router

> Route http requests through a kabuki service handler

Latest version **1.0.2** (published 2015-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install kabuki-http-router
pnpm add kabuki-http-router
yarn add kabuki-http-router
bun add kabuki-http-router
```

## 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 | 1.0.2 |
| Published | 2015-04-13 |
| First published | 2015-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Stephen Belanger |
| Maintainers | qard |
| Keywords | kabuki, router, http, promise, rpc |

## Links

- npm: https://www.npmjs.com/package/kabuki-http-router
- npm.io page: https://npm.io/package/kabuki-http-router

## Dependencies (6)

- [uuid](https://npm.io/package/uuid.md) ~2.0.1
- [bluebird](https://npm.io/package/bluebird.md) ~2.9.24
- [defaults](https://npm.io/package/defaults.md) ~1.0.2
- [lru-cache](https://npm.io/package/lru-cache.md) ~2.5.2
- [promise-route](https://npm.io/package/promise-route.md) ~1.0.0
- [transform-arguments](https://npm.io/package/transform-arguments.md) ~1.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

- 1.0.2 (latest) — 2015-04-13
- 1.0.1 — 2015-04-13
- 1.0.0 — 2015-04-13

## README

# kabuki-http-router

This is an experimental module to allow interacting with a
[kabuki](http://npm.im/kabuki) service through HTTP. It has basic session
support and works with any framework supported by
[promise-route](http://npm.im/promise-route).

## Install

```sh
npm install kabuki-http-router
```

## Usage

```js
import routeBuilder from 'kabuki-http-router'
import router from 'koa-router'
import koa from 'koa'

// Define a kabuki service
let api = (session) => {
  return session.register('hello', (name) => {
    return `Hello, ${name}`
  })
}

// Build router to map request handlers to service calls
let build = routeBuilder(api, {
  framework: 'koa'
})

// Create koa app
let app = koa()
app.use(router(app))

// Translate GET /hello/:name requests to service.hello(name) calls
app.get('/hello/:name', build('hello', [
  { get: 'params.name' }
]))

app.listen(3000)
```

---

### Copyright (c) 2015 Stephen Belanger
#### Licensed under MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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