Guest User

Untitled

a guest
Oct 18th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. 'use strict';
  2.  
  3. const HauteCouture = require('haute-couture'),
  4. Config = require('./config');
  5.  
  6.  
  7. module.exports = (server, options, next) => {
  8.  
  9. // Get the Confidence object from the server.app object.
  10. const store = server.app.store;
  11.  
  12. // Load and parse the config for this plugin.
  13. store.load(Config);
  14. const config = store.get('/', { env: server.app.env });
  15.  
  16. // Merge the local config with any passed in options.
  17. options = Object.assign(options, config);
  18.  
  19. HauteCouture.using()(server, options, (err) => {
  20. if (err) throw err;
  21.  
  22. return next();
  23. });
  24. };
  25.  
  26. module.exports.attributes = {
  27. name: 'plugin-api'
  28. };
Add Comment
Please, Sign In to add comment