Skip to content

Instantly share code, notes, and snippets.

@jeff-kilbride
Created October 17, 2017 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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