feathers-memory
An in memory CRUD service for Feathers.
Installation
npm install feathers-memory --save
Documentation
Please refer to the Feathers database adapter documentation for more details or directly at:
Complete Example
Here is an example of a Feathers server with a messages
in-memory service that supports pagination:
import feathers from 'feathers';
import bodyParser from 'body-parser';
import rest from 'feathers-rest';
import memory from '../lib';
const app = feathers()
.configure(rest())
.use(bodyParser.json())
.use(bodyParser.urlencoded({ extended: true }));
app.use('/messages', memory({
paginate: {
default: 2,
max: 4
}
}));
app.service('messages').create({
text: 'Server message',
read: false
}).then(function(message) {
console.log('Created message', message);
});
var port = 3030;
app.listen(port, function() {
console.log(`Feathers server listening on port ${port}`);
});
You can run this example with npm run example
from the cloned repository and going to localhost:3030/messages. You will see the test Message that we created at the end of that file.
Changelog
0.6.0
- Use internal methods instead of service methods directly
0.4.0/0.5.0
- Migrate to new ES6 plugin infrastructure and support all advanced querying mechanisms (#10)
0.3.0
- Fixing how the module is exported.
- Adding
PATCH
support back in
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
License
Copyright (c) 2015
Licensed under the MIT license.