Share assets across applications
$ npm install --save poe-assets-proxy
// app.js
var proxy = require(poe-assets-proxy');
var db = require('./db');
var app = module.exports = proxy(db, {
secret: 'MY_SHARED_SECRET' // this secret should be shared across app servers and be sent every time there is a manifest update
});
// db.js
exports.replace = function(name, manifest, cb) {
// will be called anytime there is a new manifest
};
exports.lookup = function(path, cb) {
// will be called anytime there is a request for an asset.
// this function should cb() an array of endpoints that host
// the particular asset
}
$ npm test