# koa-orbit

> A server interface for Orbit sources

Latest version **0.2.1** (published 2021-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-orbit
pnpm add koa-orbit
yarn add koa-orbit
bun add koa-orbit
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2021-02-28 |
| First published | 2021-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 50.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Paul Chavard |
| Maintainers | tchak |

## Links

- npm: https://www.npmjs.com/package/koa-orbit
- Repository: https://github.com/tchak/koa-orbit
- Homepage: https://github.com/tchak/koa-orbit#readme
- Issues: https://github.com/tchak/koa-orbit/issues
- npm.io page: https://npm.io/package/koa-orbit

## Dependencies (5)

- [qs](https://npm.io/package/qs.md) ^6.9.6
- [koa-router](https://npm.io/package/koa-router.md) ^10.0.0
- [@orbit/jsonapi](https://npm.io/package/@orbit/jsonapi.md) ^0.17.0-beta.14
- [@orbit/records](https://npm.io/package/@orbit/records.md) ^0.17.0-beta.14
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.3.0

## Recent versions

- 0.2.1 (latest) — 2021-02-28
- 0.2.0 — 2021-02-28
- 0.1.1 — 2021-02-21
- 0.1.0 — 2021-02-21

## README

# Koa Orbit [![Build Status](https://github.com/tchak/koa-orbit/workflows/CI/badge.svg)](https://github.com/tchak/koa-orbit/actions)

A server interface for Orbit sources

## Getting started

A getting started template is available at [orbit-server-template](https://github.com/tchak/orbit-server-template)

## Installation

Install with yarn:

```
yarn add koa-orbit
```

```ts
import koaOrbit from 'koa-orbit';
import SQLSource from 'orbit-sql';
import { RecordSchema } from '@orbit/records';

const app = new Koa();
const source = new SQLSource({
  schema: new RecordSchema({
    models: {
      todo: {
        attributes: {
          title: { type: 'string' },
          checked: { type: 'boolean' }
        }
      }
    }
  }),
  knex: {
    client: 'sqlite3',
    connection: { filename: ':memory:' },
    useNullAsDefault: true,
  },
});

const router = koaOrbit({ source });
app.use(router.routes());
app.use(router.allowedMethods());

app.listen(3000);
```

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