# backwood-feathers-rest

> Feathers REST API provider for Adonis

Latest version **1.0.1** (published 2018-02-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install backwood-feathers-rest
pnpm add backwood-feathers-rest
yarn add backwood-feathers-rest
bun add backwood-feathers-rest
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-02-03 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Marcus S. Abildskov |
| Maintainers | marcus-sa |

## Links

- npm: https://www.npmjs.com/package/backwood-feathers-rest
- Repository: https://github.com/marcus-sa/backwood
- Homepage: https://github.com/marcus-sa/backwood/tree/master/src/Feathers/Rest
- Issues: https://github.com/marcus-sa/backwood/issues
- npm.io page: https://npm.io/package/backwood-feathers-rest

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) *
- [@adonisjs/fold](https://npm.io/package/@adonisjs/fold.md) *
- [@feathersjs/express](https://npm.io/package/@feathersjs/express.md) *

## Recent versions

- 1.0.1 (latest) — 2018-02-03
- 1.0.0 — 2018-02-01

## README

# Backwood Feathers
Backwood Feathers is a [Service Provider](https://adonisjs.com/docs/4.0/service-providers) for [AdonisJS](https://github.com/adonisjs/adonis-framework)
for people that enjoy FeathersJS but can't stand its way of file and coding structuring.

**Full docs will come soon**

## Installation
```bash
npm install --save backwood-feathers backwood-feathers-rest

yarn add --save backwood-feathers backwood-feathers-rest
```

## Usage
Okay, start off by creating a new Adonis Project using the CLI:

```bash
adonis new blog
```

now navigate to the `server.js` file and replace `.fireHttpServer()` with `.fire()` like so:

> server.js
```
'use strict'

const { Ignitor } = require('@adonisjs/ignitor')

new Ignitor(require('@adonisjs/fold'))
  .appRoot(__dirname)
  .fire() // <--
  .catch(console.error)

```

then it's also recommended to remove most of the providers, as Feathers will be handling everything else
and add the Backwood providers to the application

> start/app.js

```js
const providers = [
    'backwood-feathers',
    'backwood-feathers-rest'
]
```

### Backwood Feathers
```js
'use strict'

const primus = use('@feathersjs/primus')

const Feathers = use('Feathers')

Feathers
  .configure(primus({ transformer: 'websockets' }))
  .service('message', 'MessageService').hooks('MessageHooks')
  .service('products', 'ProductService').hooks('ProductService')
```

### Backwood Feathers REST API
```js
'use strict'

const Rest = use('Rest')

exports.globalMiddleware = [
  Rest.express.json()
]

exports.namedMiddleware = {
  test: (req, res, next) => {
    console.log('test')
    next()
  }
}

Rest
  .group(() => {
    Rest.get('/test', 'TestController.get')
  }).middleware('test')
```

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