michaelleeallen / reducto

A small module that aims to reduce the amount of code needed to create apps with a distributed back end in express.js

Home Page:http://michaelleeallen.github.io/reducto/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow services to pull params from session

michaelleeallen opened this issue · comments

When making a service call it may be necessary to use values that were passed-in by the request or some other middleware(or, for example, an SSO token). The service module should allow the developer to specify what values they want to use in their config.

{
  "service_one": {
    "get": {
      "uri": "http://some.api.com/v1/user/{userId}",
      "headers": {
        "x-api-token": "{apiKey}"
      }
    }
}

In this example the developer would like to use userId and apiKey in their service call. These tokens should be parsed out of the config and replaced with their values from session.

Added in v0.2.0