feathers-forward
A Feathers forward service adapter. Supports only rest
provider for now.
$ npm install --save feathers-forward
API
configure(options)
Configure Feathers application to forward all unknown services to remote server.
Options:
uri
(required) - Uri to remote serverendpoint
- Type of endpoint, for now supportfeathers
(not specified ===feathers
) and everything else is default behaviour of request parsingreqHeaders
- Headers to forward from REST req object (case sensitive)resHeaders
- Headers to be added to REST res object from forwarded response (case sensitive)
Example
Here's a example of configuration.
const compress = ;const helmet = ;const cors = ; const feathers = ;const configuration = ;const express = ;const forwardMiddleware = middleware;const forwardConfigure = configure; const middleware = ;const services = ; const app = ; // Load app configurationapp;// Enable security, CORS, compression, favicon and body parsingapp;app;app;app;app; // Set up Plugins and providersapp; // Configure other middleware (see `middleware/index.js`)app;app; // IMPORTANT// Set up our services (see `services/index.js`)app;// Forward everything elseapp; // Configure a middleware for 404s and the error handlerapp;app;