feathers-horizon
Horizon.js feathers plugin, this plugin will start an horizon server instance using provided options or defaults feathers config.
Goals
Plugins intent to add missing horizon.js functionality by leveraging the excellent featherjs for backend. It uses feathers authentication for local strategy
This grants you the entire featherjs ecosystem around your horizon.js application
Thank you
Made possible and inspired by the generous tailsu and his Demo: third-party authentication for horizon
Roadmap
- 0.x - proof of concept - launch horizon in feather using application configuration .
- 1.0 - Better test coverage, error handling and full options.
- 2.0 - Add horizon client for server side reactive queries.
- 3.0 - Add user copy on auth hooks in case of non rethinkdb feather app.
Installation
npm install feathers-horizon --save
Options (optionnal, will refer to feathers-configuration if provided)
Options that can be passed to the Horizon server constructor are identical to the similarly-named options that can be defined in the configuration file, with the same defaults:
- project_name: 'horizon'
- rdb_host: 'localhost'
- rdb_port: 28015
- auto_create_collection: false
- auto_create_index: false
- permissions: true
- path: '/horizon'
- auth:
- duration: '1d'
- new_user_group: 'authenticated'
- token_secret: null
- allow_anonymous: false
- allow_unauthenticated: false
Create your app using feathers generators
feathers generate app
feathers generate authentication
npm install feathers-horizon --save
Then import and configure the plugin after Authentication plugin
...
const feathersHorizon = require('feathers-horizon');
...
app.configure(authentication);
app.configure(feathersHorizon());
...
Complete Example
Here's an example of a Feathers server that uses feathers-horizon
.
const path = ;const favicon = ;const compress = ;const cors = ;const helmet = ;const bodyParser = ; const feathers = ;const configuration = ;const hooks = ;const rest = ;const socketio = ;const feathersHorizon = ;const middleware = ;const services = ;const appHooks = ; const authentication = ;const rethinkdb = ;const app = ; // Load app configurationapp;// Enable CORS, security, compression, favicon and body parsingapp;app;app;app;app;app;// Host the public folderapp; // Set up Plugins and providersapp;app;app;app;app;app;app; // Set up our services (see `services/index.js`) Configure middleware (see// `middleware/index.js`) - always has to be lastapp;app; //Create a default users for our tests. var User = email: 'admin@feathersjs.com' password: 'admin' permissions: '*'; app ;moduleexports = app;
License
Copyright (c) 2017
Licensed under the MIT license.