Created
October 17, 2017 18:04
-
-
Save jeff-kilbride/426b0f921220d78f904e8cafe5becc27 to your computer and use it in GitHub Desktop.
Plugin index file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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