fms
A FileMaker Adapter For Feathers.js.
About
This is a FileMaker Adapter for feathers.js. It makes it trivial to create a feathers service for any FileMaker Layout. For non FileMaker people, a layout is a Table with a defined set of fields, and related records.
This currently passes all but two tests in the feathers-service-test suite. There is not an easy way to do a a true POST, which would require nulling fields. When you POST, you basically just get a Patch. We also do not support the $in and $nin query filters. We may in the future. Support for $or is limited. Only single fields will work.
Install
npm install feathers-filemaker --save
Documentation
This adapter works like others Feathers Adapters. Please refer to the Feathers database adapter documentation for more details or directly at:
FileMaker Specific Configuration
This adapter takes two additional keys in it's configuration object: connection
and model
Connection
connection :{
host : 'localhost',
db : 'Contacts'
user : 'admin'
pass : 'pass'
}
Model
model :{
layout : 'Contacts'
idField : 'id'
Connection specifies the host, database, user, and password to connect to the database. model specifies the layout and idField to use for the feathers service. See the complete example below for more information.
Complete Example
var feathers = require('feathers');
var bodyParser = require('body-parser');
var rest = require('feathers-rest');
var socketio = require('feathers-socketio');
var mms = require('feathers-memory');
const app = feathers()
.configure(rest())
.configure(socketio())
.use(bodyParser.json())
.use(bodyParser.urlencoded({ extended: true }));
app.use('/contacts', fms({
connection :{
host : 'localhost',
db : 'Contacts'
user : 'admin'
pass : 'pass'
},
model :{
layout : 'Contacts'
idField : 'id'
},
paginate: {
default: 2,
max: 4
}
}));
var port = 3030;
app.listen(port, function() {
console.log(`Feathers server listening on port ${port}`);
});
License
Copyright Todd Geist(c) 2016
Licensed under the MIT license