{"_id":"the-conductor","_rev":"71-dc4b7be3868235b0891fc2dca73ff5b6","name":"the-conductor","description":"An API Orchestration Layer (OL)","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.2":{"name":"the-conductor","version":"0.0.2","description":"An API Orchestration Layer (OL)","main":"index.js","author":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"_id":"the-conductor@0.0.2","dist":{"shasum":"a587efb8ee0dc314ab674346bab37575c5407172","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.0.2.tgz","integrity":"sha512-K3urW/TvbpsnZTAsRdJrf+qNoJlmX8W3kOj0etF9JBGmEeCPtrYOm4JIaAoSLz13trqA26y5JsMqLT8ZalZ3rQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDc9UGTYBLlDwykGXsWLKET6eRsODLw186YYo4VVwnN+AiEA7GPbdW/E/X09LRdjduLFSJsHU++a2rF+jZlgz/Scxi4="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}],"directories":{}},"0.0.3":{"name":"the-conductor","version":"0.0.3","description":"An API Orchestration Layer (OL)","main":"index.js","author":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"_id":"the-conductor@0.0.3","dist":{"shasum":"11bdafa06eeb33806242a02e2f35032a79465da7","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.0.3.tgz","integrity":"sha512-ON82Sv9NJV9oh4A0aBaRd9pNWLfmU+oV7GGHTQYav64s+P8U1tGIRddC6Ov3H5VOKAJGeRntxhQdQiUyTvq5mA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJLWsXv/vqZ1lDetAMu2IyXaMpJCrW1Xd375OhHikBiwIhAIP3ikSPPXmwOTz8noIzwbQvfC3klw42yCpRnz7ZHf9Z"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}],"directories":{}},"0.0.4":{"name":"the-conductor","version":"0.0.4","description":"An API Orchestration Layer (OL)","main":"index.js","author":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"_id":"the-conductor@0.0.4","dist":{"shasum":"61fcf9535e87e8ea6cd62e748c56efafaad297ac","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.0.4.tgz","integrity":"sha512-X2OK/FTeXHzGURrSS0XbEHExwUdeLYiadLTIm3oQMnM+FRuwUnsABX9RFP+sDnSZmqNWJna8k7YnRroc11KMww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4vKHFQgWi3FEljaiAcTCXocepq86fno97eE0MMoFgeAIgZDFhEz0Kxwn0zoXrSBFg8UIQbqHch1493Nmvr07EkKY="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}],"directories":{}},"0.0.5":{"name":"the-conductor","version":"0.0.5","description":"An API Orchestration Layer (OL)","main":"index.js","author":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"_id":"the-conductor@0.0.5","dist":{"shasum":"2c50c30546d548c76a36f90fc3599d3784747787","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.0.5.tgz","integrity":"sha512-THdDiPzarODiYFU9SdzfsevhAN9qM/Q/uB7API3xWPfh7rmbi0g7EtPDBOY27TI4HwUSqBvyKy7Vrj039JmVdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeBQNQALnu/OMZ1F2+xOEb1zrYCxgSsyqaqu4RRyKEuQIhANrF1WGIstg0MUq16GS/auogAPNryko6OQKRG9n2JHYN"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}],"directories":{}},"0.0.6":{"name":"the-conductor","version":"0.0.6","description":"An API Orchestration Layer (OL)","main":"index.js","author":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"_id":"the-conductor@0.0.6","dist":{"shasum":"a6db203584dce326c71db5072ddacc9d996b8035","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.0.6.tgz","integrity":"sha512-+X8gi5KpsCXYq2ibQ8SP4DXVm1DGnZyblDEjDL5kPNmyUpjqVLtUrBAPyeDTBaWNEKwp0iFN0AKRWO0HwTuang==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/0NfxA/41CvGSHpHmH6KW+6jS/oXRcHoiw4RXfzBm5wIgOb2AquZ2YGAd2x1Iln+aZBoh7ZUWsAs3uUcau4gF4Nw="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}],"directories":{}},"0.1.0":{"name":"the-conductor","version":"0.1.0","description":"An API Orchestration Layer (OL)","main":"index.js","author":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"_id":"the-conductor@0.1.0","dist":{"shasum":"7931cb014fbd153e3ed8e4fa1275a67b28da503a","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.1.0.tgz","integrity":"sha512-NQbq7lyayczOAJmGMjrPp7mJv0ywO1j2hi6TxlCz44NWJ3gIV1ClWLooqgjSZoRL8ZjzTv0zRDf2gtkdN87WgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDb4kGUzBE9gvSma7ta8Jyb+SrWAHVaSRtAwjoWpUHeZAIgL/5RfKzSdh5zEkBByPe4v3+SqfiXaidV3m36GR76HFQ="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}],"directories":{}},"0.1.1":{"name":"the-conductor","version":"0.1.1","description":"An API Orchestration Layer (OL)","main":"index.js","author":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"_id":"the-conductor@0.1.1","dist":{"shasum":"250ba2ea583084d6c22695d24adb909fe30be52c","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.1.1.tgz","integrity":"sha512-Mm80rAzgcwVLLYX1Ank4wBBM4jCckkPG30045/utJcW0pnemtoJFE6YpL0KHbalu+G12w81iURg+61Fapu+QMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICynXyfSnkHqy0HILh9yHvQFxecr0fXVjR29/qST+jFEAiBUExoksb6jwfQNZiC1pOsu67pnj5QQWP94wtzT1LWx5A=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}]},"0.1.2":{"name":"the-conductor","version":"0.1.2","description":"An API Orchestration Layer (OL)","homepage":"https://github.com/odino/the-conductor","repository":{"type":"git","url":"http://github.com/odino/the-conductor.git"},"keywords":["api","apis","orchestration","layer","http","webserver","rest","odino","conductor","the-conductor"],"main":"lib/the-conductor.js","author":{"name":"Alessandro Nadalin","email":"alessandro.nadalin@gmail.com","url":"http://odino.org/"},"engines":{"node":">= 0.8.x"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"bugs":{"url":"https://github.com/odino/the-conductor/issues"},"_id":"the-conductor@0.1.2","dist":{"shasum":"912e8539e90d988bc5f6b6810aea05bb2c82fc26","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.1.2.tgz","integrity":"sha512-Pi1e5/9GgRyU+TvBjs8STJvOG31P0SGIUW0EjojZUNE02wsxahN1Ds0nTOvgmGP1KXW6C1yxhopaz1LW8ypIIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBz3i6kuqcVNnyAzHgH0IwRReCqrEBFWJ9UUdpjwG6PaAiEAy8wjLoN0BI+tE1c6znqCt1ZFrOcyNnpwlJpsUoqs+b0="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}]},"0.2.0":{"name":"the-conductor","version":"0.2.0","description":"An API Orchestration Layer (OL)","homepage":"https://github.com/odino/the-conductor","repository":{"type":"git","url":"http://github.com/odino/the-conductor.git"},"keywords":["api","apis","orchestration","layer","http","webserver","rest","odino","conductor","the-conductor"],"main":"lib/the-conductor.js","author":{"name":"Alessandro Nadalin","email":"alessandro.nadalin@gmail.com","url":"http://odino.org/"},"engines":{"node":">= 0.8.x"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"bugs":{"url":"https://github.com/odino/the-conductor/issues"},"_id":"the-conductor@0.2.0","dist":{"shasum":"284961298fc023a4ef5e63e9f99e84b845b489e2","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.2.0.tgz","integrity":"sha512-CHrOYIEGwmJDVFWmQYVdAeuPo2LzGubb49NQELWnDXvf4I4VRKZZaPuvcbDCYeaDF7Md/lBnOfoPLPGm6U9k0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHT/SqVPZoaIQL9bblih9ufmUvaQmfi8+/jxpvoI1IeAiANBe5enxEJpUGC4DQ2gHF/Eo+CgOboD2Y6nuURfiP6VA=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}]},"0.2.1":{"name":"the-conductor","version":"0.2.1","description":"An API Orchestration Layer (OL)","homepage":"https://github.com/odino/the-conductor","repository":{"type":"git","url":"http://github.com/odino/the-conductor.git"},"keywords":["api","apis","orchestration","layer","http","webserver","rest","odino","conductor","the-conductor"],"main":"lib/the-conductor.js","author":{"name":"Alessandro Nadalin","email":"alessandro.nadalin@gmail.com","url":"http://odino.org/"},"engines":{"node":">= 0.8.x"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2","http-https":"~1.0"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"bugs":{"url":"https://github.com/odino/the-conductor/issues"},"_id":"the-conductor@0.2.1","dist":{"shasum":"b3988b8eb7c8d40dfc84aa7a48c6802c48b710fe","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.2.1.tgz","integrity":"sha512-43KCWrdnYNgV3kqRKZH0t2Lfgum39ugt6RsV3kvi7mYOtn11DC513q34mjiu8h3Rlai1kcCKe2NrQI1aM25gVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs2EZEdokkCJ9t7ODDNoOMG6fgZF/U92uYP9sKvGORKgIgJ6FjIbMQVOMXVC0tDkFAGnaQRPW4ySXa+bj/M+mkLrQ="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}]},"0.2.2":{"name":"the-conductor","version":"0.2.2","description":"An API Orchestration Layer (OL)","homepage":"https://github.com/odino/the-conductor","repository":{"type":"git","url":"http://github.com/odino/the-conductor.git"},"keywords":["api","apis","orchestration","layer","http","webserver","rest","odino","conductor","the-conductor"],"main":"lib/the-conductor.js","author":{"name":"Alessandro Nadalin","email":"alessandro.nadalin@gmail.com","url":"http://odino.org/"},"engines":{"node":">= 0.8.x"},"license":"MIT","dependencies":{"optimist":"~0.6","underscore":"~1.5","winston":"~0.7","underscore.string":"~2.0","odino.router":"*","js-yaml":"~3","async":"~0.2","http-https":"~1.0"},"devDependencies":{"mocha":"~1.0","should":"~2.0","nodemon":"*"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"bugs":{"url":"https://github.com/odino/the-conductor/issues"},"_id":"the-conductor@0.2.2","dist":{"shasum":"6afd6ed6dee1912df856f7a102deefad1c1bd431","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.2.2.tgz","integrity":"sha512-eIWW02ZxNEb8S9V4V5Dh0FmrrQOA5x2QwnKD2TirYIpnjPkRF4jPSlvp2SsWeTBz6RzrnAwWLyFrgiapUXNK2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1pLH4f/x6Hg/j7iTmEq7g5Kw4mrI0OzXRU+5PI6gTuAiAmOflBRcaFtg6drhmq8h9PGlUJvsdunYl/HecexKewzg=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}]},"0.3.0":{"name":"the-conductor","version":"0.3.0","description":"An API Orchestration Layer (OL)","homepage":"https://github.com/odino/the-conductor","repository":{"type":"git","url":"http://github.com/odino/the-conductor.git"},"keywords":["api","apis","orchestration","layer","http","webserver","rest","odino","conductor","the-conductor"],"main":"lib/the-conductor.js","author":{"name":"Alessandro Nadalin","email":"alessandro.nadalin@gmail.com","url":"http://odino.org/"},"engines":{"node":">= 0.8.x"},"license":"MIT","dependencies":{"optimist":"*","underscore":"*","winston":"*","underscore.string":"*","odino.router":"*","js-yaml":"*","async":"*","http-https":"*"},"devDependencies":{"mocha":"*","should":"*","nodemon":"*"},"scripts":{"test":"./node_modules/mocha/bin/mocha"},"bugs":{"url":"https://github.com/odino/the-conductor/issues"},"_id":"the-conductor@0.3.0","dist":{"shasum":"dabd7adc7188311e371b5341ced41cd61f83c8a8","tarball":"https://registry.npmjs.org/the-conductor/-/the-conductor-0.3.0.tgz","integrity":"sha512-sbHIJHKKIcon62orgQmjZf+d3oLyQgR5oHvfR1t3WzH29+IFBRCKd+WPfwEp+xITjVaEIGjFUpPnplJz/jBuHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClqAXiuXdeuIzA20zH7JCBIsNyZcp8I1i++b/Xjp0XjwIhALlFG717jXPgB60+K0sAg63JRt7Mqryb9dQ4+Q8kDDzb"}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"odino","email":"alessandro.nadalin@gmail.com"},"maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}]}},"readme":"[![NPM version](https://badge.fury.io/js/the-conductor.png)](http://badge.fury.io/js/odino.router)\n[![Build Status](https://travis-ci.org/odino/the-conductor.png?branch=master)](https://travis-ci.org/odino/the-conductor)\n[![Dependency Status](https://gemnasium.com/odino/the-conductor.png)](https://gemnasium.com/odino/the-conductor)\n\n![logo of the conductor](https://github.com/odino/the-conductor/blob/master/images/conductor.png?raw=true)\n\n## Why?\n\nJump into [the future of API design](http://thenextweb.com/dd/2013/12/17/future-api-design-orchestration-layer/)\nand add an *orchestration layer* to your APIs.\n\nIn order to understand what an orchestration layer does, take a look at the following image:\n\n![api comparison](http://cdn2.tnwcdn.com/wp-content/blogs.dir/1/files/2013/12/resource-v-experience-apis.png)\n\nIn simple words: an API Orchestration Layer (OL) is responsible for assembling different API responses\n(ie. `/product/123` and `/product/123/reviews`) at a single endpoint (ie. `/view/web/product/123`), so that a service\ncan make one single call to that endpoint and retrieve all the informations needed to render its views with\na single API call.\n\nThe advantage of this approach is that:\n\n* you can spread the workload over multiple, concurrent requests\n* you can have very clean, separate, decoupled, resource-oriented APIs on the background\n\nIf your applications uses different APIs to build user interfaces, you might want to invest on your own orchestra!\nAnd in order for an orchestra to be succesfull, it needs a very good *conductor*.\n\nNot a simple conductor, **the conductor**.\n\n## Installation\n\nYou can simply include it via `npm install the-conductor`\n\nThis package follow semantic versioning, so if you want to always ensure backwards compatibility just use:\n\n```\n\"the-conductor\": \"~0.1\"\n```\n\n## How it works\n\nThere are 2 main concepts that you will have to understand before using the conductor:\n\n* **resources**: these are objects representing your resource-oriented APIs, that the conductor will call in order\nto assemble its responses\n* **facade**: the endpoint of the conductor, a facade allows you to define which resources should be aggregated\nthere (and a few other, minor, things, like how the conductor should assemble the responses from the sub-requests it\nmakes)\n\n## Try it live!\n\nAfter you cloned the repository, run `npm install` and then run the example server:\n\n```\nnode example/index.js\n```\n\nthen hit `http://127.0.0.1:6971/example.json` and see it in action: you will see some JSON which is the result of\n[a bunch of HTTP calls](https://github.com/odino/the-conductor/blob/master/example/config.yml#L1):\n\n![example calls](https://github.com/odino/the-conductor/blob/master/images/example.png?raw=true)\n\nHave a look at the [example folder](https://github.com/odino/the-conductor/tree/master/example) in the source code.\n\n## Usage\n\nUsing the conductor it's a matter of a few lines of code:\n\n``` javascript\nvar conductor   = require('the-conductor');\nvar http        = require('http');\n\nhttp.createServer(conductor.run()).listen(conductor.getPort());\nconsole.log(\"server started on port \" + conductor.getPort())\n```\n\nand then you can simply run `node yourFile.js`: by default, the conductor will run on port `6971`, but you can override\nthis setting by just specifying the port during the startup process (for example `-p 8080`).\n\n## Configuration\n\nOf course, the above example won't be very helpful since we are not telling the conductor on which routes it should\nlisten to, nor which facades to run for those routes; to do that, we simply have to 1. add some routes and 2. add facades\nand configure them.\n\nIn order for our conductor to respond to a request hitting `http://example.org/web/view/users/john`, for example, we simply need\nto add a new route (the router used by the conductor is [odino.router](https://npmjs.org/package/odino.router)):\n\n``` javascript\nconductor.router.load({\n    example: {\n        pattern: \"/example.json\",\n        facade: \"f1\"\n    }\n});\n```\n\nIn this way we are telling the conductor that for whichever request that hits `/web/view/users/:username` it will need\nto run the `user_detail` facade. But how do we define what the facade does?\n\nWe can simply populate the `conductor.config` object with these informations:\n\n``` javascript\nconductor.config.resources = {\n    user_details: {\n        url: \"http://api.example.org/users/:username\"\n    },\n    user_friends: {\n        url: \"http://api.example.org/users/:username/friends\"\n    }\n};\n\nconductor.config.facades = {\n    'web_user_details': {\n        resources: [\n            'user_details',\n            'user_friends'\n        ]\n    }\n};\n```\n\nor, alternatively (recommended), dump the configuration in a more readable YML file and load it:\n\n``` javascript\nconductor.loadConfigFile('./path/to/your/config.yml');\n```\n\nThe YML would then look very simple:\n\n``` yaml\nresources:\n user_detail:\n    url:  \"http://api.example.org/users/:username\"\n  user_friends:\n    url:  \"http://api.example.org/users/:username/friends\"\nfacades:\n  web_user_details:\n    resources:\n      - user_detail\n      - user_friends\n\n```\n\nAt this point everything should be a bit clearer:\n\n* whenever someone hits `http://example.org/web/view/users/:username` the conductor will match the route `web_user_details`\n* at that point, it will see that it needs to run the facade `user_detail`\n* the conductor will then look into its config, finding out that it needs to hit `http://api.example.org/users/:username`\nand `http://api.example.org/users/:username/friends`, assembles the responses and serve them to the client\n\nSimple as that!\n\n## Facade strategies\n\nA **facade strategy** is what the conductor runs to assemble the sub-responses it obtains from a facade's resources.\n\nThe conductor comes bundled with some very simple strategies:\n\n* **join**, which simply joins all the response bodies altogether\n* **merge**, which merges the responses (to be used with JSON responses)\n\nIn order to specify which facade strategy to use for a particular facade, simply specify it in your config:\n\n``` yaml\nfacades:\n  web_user_details:\n    strategy: join\n    resources:\n      - user_detail\n      - user_friends\n```\n\nThe `join` strategy can be omitted, as it's the default one.\n\n## Custom facade strategies\n\nYou can also register and use your own facade strategies by simply specifying them in your configuration and register\nthem inside the conductor.\n\nFirst, update your configuration:\n\n``` yaml\nfacades:\n  web_user_details:\n    strategy: custom\n    resources: ...\n```\n\nthen register the strategy in the conductor:\n\n``` javascript\nconductor.addFacadeStrategy('custom', function(response, resources, defaultHeaders){\n    response.writeHead(200, defaultHeaders);\n    response.write(resources[0].response.body);\n    response.end();\n});\n```\n\nIn this example, the `custom` facade strategy only returns the body of the first sub-response.\n\n## Debugging help\n\nIf you start the conductor in **dev environment** (`--env dev` or  `-e dev`) you will get some additional informations\neverytime you hit an endpoint, such as a list of resources and the body of each resource the conductor hit in order to\nserve the response:\n\n```\n~  ᐅ curl -X GET -I http://127.0.0.1:6971/example.json\n\nHTTP/1.1 200 OK\nContent-Type: text/plain\nThe-Conductor-Resource-ip.jsontest.com/: {\"ip\": \"91.72.216.244\"}\nThe-Conductor-Resource-echo.jsontest.com/key/value/one/two: {\"one\": \"two\",\"key\": \"value\"}\nThe-Conductor-Resource-cookie.jsontest.com/: {\"cookie_status\": \"Cookie set with name jsontestdotcom\"}\nThe-Conductor-Resource-headers.jsontest.com/: {\"Host\": \"headers.jsontest.com\",\"User-Agent\": \"\"}\nThe-Conductor-Resource-md5.jsontest.com/?text=sometext: {\"md5\": \"a29e90948f4eee52168fab5fa9cfbcf8\",\"original\": \"sometext\"}\nThe-Conductor-Resource-date.jsontest.com/: {\"time\": \"03:16:35 PM\",\"milliseconds_since_epoch\": 1388848595956,\"date\": \"01-04-2014\"}\nThe-Conductor-Resources: ip.jsontest.com/, echo.jsontest.com/key/value/one/two, cookie.jsontest.com/, headers.jsontest.com/, md5.jsontest.com/?text=sometext, date.jsontest.com/\nThe-Conductor-Runtime: 566\nConnection: keep-alive\nTransfer-Encoding: chunked\n```\n\n## Tests\n\nTests are written with mocha and should.js: after you cloned the repo simply run `mocha` or its verbose cousin\n`./node_modules/mocha/bin/mocha` and everything should be green!","maintainers":[{"name":"odino","email":"alessandro.nadalin@gmail.com"}],"time":{"modified":"2022-06-27T05:56:15.668Z","created":"2014-01-03T23:09:09.407Z","0.0.2":"2014-01-03T23:09:12.480Z","0.0.3":"2014-01-03T23:50:35.301Z","0.0.4":"2014-01-04T01:07:52.438Z","0.0.5":"2014-01-04T01:30:25.514Z","0.0.6":"2014-01-04T14:01:54.800Z","0.1.0":"2014-01-04T15:18:31.038Z","0.1.1":"2014-01-04T19:35:34.245Z","0.1.2":"2014-01-05T07:22:18.633Z","0.2.0":"2014-01-05T12:27:03.920Z","0.2.1":"2014-01-05T13:00:27.380Z","0.2.2":"2014-01-05T13:45:45.152Z","0.3.0":"2014-06-13T00:19:37.112Z"},"author":{"name":"Alessandro Nadalin","email":"alessandro.nadalin@gmail.com","url":"http://odino.org/"},"repository":{"type":"git","url":"http://github.com/odino/the-conductor.git"},"homepage":"https://github.com/odino/the-conductor","keywords":["api","apis","orchestration","layer","http","webserver","rest","odino","conductor","the-conductor"],"bugs":{"url":"https://github.com/odino/the-conductor/issues"},"license":"MIT","readmeFilename":"README.md"}