fluxible-plugin-fetchr
Advanced tools
Comparing version 0.3.1 to 0.3.3
@@ -26,7 +26,7 @@ # Fetchr Plugin API | ||
[register a service](#Registering Your Services) with fetchr. For server side only. | ||
[register a service](../README.md#registering-your-services) with fetchr. For server side only. | ||
### getMiddleware | ||
getter for fetchr's express/connect middleware. For server side only. See [usage](#Exposing Your Services) | ||
getter for fetchr's express/connect middleware. For server side only. See [usage](../README.md#exposing-your-services) | ||
@@ -33,0 +33,0 @@ ## actionContext Methods |
@@ -22,3 +22,8 @@ /** | ||
var args = Array.prototype.slice.call(arguments); | ||
// Faster than calling Array.prototype.slice.call(arguments) | ||
var args = new Array(arguments.length); | ||
for (var i = 0; i < args.length; ++i) { | ||
args[i] = arguments[i]; | ||
} | ||
// replace last argument (callback) with proxy callback | ||
@@ -53,2 +58,3 @@ // this is because 'config' is an optional param for services | ||
var xhrPath = options.xhrPath || DEFAULT_API_PATH; | ||
var corsPath = options.corsPath || null; | ||
@@ -84,6 +90,9 @@ /** | ||
plugActionContext: function plugActionContext(actionContext) { | ||
var uri; | ||
var serviceMeta = []; | ||
var service = new Fetchr({ | ||
req: contextOptions.req, | ||
xhrPath: xhrPath, | ||
corsPath: corsPath, | ||
context: xhrContext | ||
@@ -98,4 +107,5 @@ }); | ||
config = config || {}; | ||
uri = config.cors ? corsPath : xhrPath; | ||
var getUriFn = config.constructGetUri || defaultConstructGetUri; | ||
return getUriFn.call(service, xhrPath, resource, params, config, xhrContext); | ||
return getUriFn.call(service, uri, resource, params, config, xhrContext); | ||
} | ||
@@ -115,3 +125,4 @@ }; | ||
xhrContext: contextOptions.xhrContext, | ||
xhrPath: xhrPath | ||
xhrPath: xhrPath, | ||
corsPath: corsPath | ||
}; | ||
@@ -127,2 +138,3 @@ }, | ||
xhrPath = state.xhrPath; | ||
corsPath = state.corsPath; | ||
} | ||
@@ -129,0 +141,0 @@ }; |
{ | ||
"name": "fluxible-plugin-fetchr", | ||
"version": "0.3.1", | ||
"version": "0.3.3", | ||
"description": "A plugin for Fluxible applications to provide an isomorphic interface for RESTful services", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
16400
197