feathers-filemaker
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -15,2 +15,6 @@ 'use strict'; | ||
options.connection.db = options.connection.db || 'NA'; | ||
options.connection.user = options.connection.user || 'NA'; | ||
options.connection.pass = options.connection.pass || 'passNA'; | ||
return function () { | ||
@@ -17,0 +21,0 @@ |
{ | ||
"name": "feathers-filemaker", | ||
"description": "Filemaker adapter for feathers.js", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/geistinteractive/feathers-filemaker", | ||
@@ -47,2 +47,3 @@ "main": "lib/", | ||
"dependencies": { | ||
"basic-auth": "^1.0.4", | ||
"debug": "^2.2.0", | ||
@@ -49,0 +50,0 @@ "feathers": "^2.0.1", |
@@ -160,29 +160,61 @@ # fms | ||
Partial Example: | ||
Example: | ||
```javascript | ||
//require feathers-filemaker | ||
var fms = require('feathers-filemaker'); | ||
// app.js of generated feathers app | ||
const path = require('path'); | ||
const serveStatic = require('feathers').static; | ||
const favicon = require('serve-favicon'); | ||
const compress = require('compression'); | ||
const cors = require('cors'); | ||
const feathers = require('feathers'); | ||
const configuration = require('feathers-configuration'); | ||
const hooks = require('feathers-hooks'); | ||
const rest = require('feathers-rest'); | ||
const bodyParser = require('body-parser'); | ||
const socketio = require('feathers-socketio'); | ||
const middleware = require('./middleware'); | ||
const services = require('./services'); | ||
// get the Service from the adaptor | ||
var SimpleRESTService = fms.SimpleRESTService; | ||
//get SimpleRestService from feathers-filemaker | ||
const fm = require('feathers-filemaker'); | ||
const SimpleRestService = fm.SimpleRESTService; | ||
// Create a feathers app as normal | ||
// there other things you can add here but this is the bare minimum. | ||
const app = feathers() | ||
// you'll need a connection | ||
const connection = { | ||
host : 'localhost', | ||
db : 'Test', // ignored | ||
user : 'wrong', // optional, overwritten by basic auth | ||
pass : 'wrong' // optional, overwritten by basic auth | ||
}; | ||
const app = feathers(); | ||
app.configure(configuration(path.join(__dirname, '..'))); | ||
app.use(compress()) | ||
.options('*', cors()) | ||
.use(cors()) | ||
.use(favicon( path.join(app.get('public'), 'favicon.ico') )) | ||
.use('/', serveStatic( app.get('public') )) | ||
.use(bodyParser.json()) | ||
.use(bodyParser.urlencoded({ extended: true })) | ||
.configure(hooks()) | ||
.configure(rest()) | ||
.use(bodyParser.json()) | ||
.use(bodyParser.urlencoded({ extended: true })) | ||
.configure(socketio()) | ||
.configure(services) | ||
// configure the Simple REST Service | ||
.configure( SimpleRESTService({ | ||
connection, | ||
model, | ||
prefix : 'rest' // url will be http://<address>:<port>/rest/db/layout | ||
})) | ||
//make sure you have the error handler | ||
.use(errorHandler()) | ||
//configure SimpleRestService here | ||
.configure(SimpleRestService({ | ||
connection, | ||
prefix : 'rest' | ||
})) | ||
// middleware should be last | ||
.configure(middleware); | ||
module.exports = app; | ||
``` | ||
@@ -189,0 +221,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
299382
1241
226
11
+ Addedbasic-auth@^1.0.4
+ Addedbasic-auth@1.1.0(transitive)