1.0.6 • Published 6 years ago

@backwood/rest v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Backwood Feathers REST

Backwood Feathers is a Service Provider for AdonisJS

Full docs will come soon

This is a service provider for providing REST to Feathers

Packages

Installation

npm install --save @backwood/rest

Usage

Add @backwood/rest to the app providers in start/app.js

Backwood REST

Create a mandatory file called rest.js in the start directory.

start/rest.js

'use strict'

const Rest = use('Rest')

exports.globalMiddleware = Rest.express.json(), Rest.express.urlencoded({ extended: false })

exports.namedMiddleware = { auth: (req, res, next) => { return !req.user ? next(false) : next() }, guest: (req, res, next) => { return req.user ? next(false) : next() } }

Rest .service('user', 'UserService') .group(() => { Rest.get('/login', 'LoginController.get') }).options({ middleware: 'guest', prefix: 'guest', namespace: 'Guest' })

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago