Skip to content

Instantly share code, notes, and snippets.

@jeff-kilbride
Created October 17, 2017 18:04
Show Gist options
  • Save jeff-kilbride/426b0f921220d78f904e8cafe5becc27 to your computer and use it in GitHub Desktop.
Save jeff-kilbride/426b0f921220d78f904e8cafe5becc27 to your computer and use it in GitHub Desktop.
Plugin index file
'use strict';
const HauteCouture = require('haute-couture'),
Config = require('./config');
module.exports = (server, options, next) => {
// Get the Confidence object from the server.app object.
const store = server.app.store;
// Load and parse the config for this plugin.
store.load(Config);
const config = store.get('/', { env: server.app.env });
// Merge the local config with any passed in options.
options = Object.assign(options, config);
HauteCouture.using()(server, options, (err) => {
if (err) throw err;
return next();
});
};
module.exports.attributes = {
name: 'plugin-api'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment