Bee Queue as feathers-plugin
npm install feathers-bee --save
app.use('/bee', bee({
service: app.service('serviceToLog'), // add your service
name: 'example'
}));
The bee-queue events are implemented as custom feathers events
Here’s an example of a Feathers server that uses feathers-bee
.
const feathers = require('feathers');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const handler = require('feathers-errors/handler');
const bodyParser = require('body-parser');
const memory = require('feathers-memory');
const bee = require('feathers-bee');
// Create a feathers instance.
const app = feathers()
.configure(socketio())
.configure(rest())
.use(bodyParser.json())
.use(bodyParser.urlencoded({extended: true}));
// Create any service you like.
app.use('/messages', memory({
paginate: {
default: 2,
max: 4
},
id:'_id'
}));
// Create bee service
app.use('/bee', bee({
service: app.service('messages'), // add your service
name: 'example', // name
queue: {}, // queue settings
paginate: {
default: 2,
max: 4
}
}));
// A basic error handler, just like Express
app.use(handler());
// Start the server
var server = app.listen(3030);
server.on('listening', function () {
console.log('Feathers running on 127.0.0.1:3030');
});
Copyright (c) 2017
Licensed under the MIT license.