feathers-linvodb
Create an LinvoDB Service for FeatherJS.
Installation
npm install linvodb3 feathers-linvodb --save
Documentation
Please refer to the Feathers database adapter documentation for more details or directly at:
- NeDB - The detailed documentation for this adapter
- Extending - How to extend a database adapter
- Pagination and Sorting - How to use pagination and sorting for the database adapter
- Querying - The common adapter querying mechanism
Complete Example
Here's an example of a Feathers server with a todos
linvodb-service.
const feathers = require('feathers');
const rest = require('feathers-rest');
const LinvoDB = require('linvodb3');
const linvodbService = require('feathers-linvodb');
const bodyParser = require('body-parser');
const db = new LinvoDB('todo', {});
var app = feathers()
.configure(rest())
.use(bodyParser.json())
.use(bodyParser.urlencoded({extended: true}));
app.use('todos', linvodbService({
Model: db,
paginate: {
default: 2,
max: 4
}
}));
var port = 3030;
app.listen(port, function() {
console.log(`Feathers server listening on port ${port}`);
});
You can run this example by using node examples/app
and going to localhost:3030/todos. You should see an empty array. That's because you don't have any Todos yet but you now have full CRUD for your new todos service.
Changelog
2.1.0
- Use internal methods instead of service methods directly
2.0.0
- Remove NeDB dependency
- Migration to ES6 and latest service test suite
- Changing the way that NeDB services are initialized to be compliant with Feathers 2.0.
1.2.0
- Migration to shared service test suite (#4)
1.0.0
0.1.1
- Minor license and documentation updates
0.1.0
License
Copyright (c) 2015
Licensed under the MIT license.
Author
Marshall Thompson