Skip to content

Instantly share code, notes, and snippets.

@geek
Last active August 29, 2015 14:02
Show Gist options
  • Save geek/752a959a34ae261a6e5a to your computer and use it in GitHub Desktop.
Save geek/752a959a34ae261a6e5a to your computer and use it in GitHub Desktop.
Example of using server packs to register plugins
var Hapi = require('hapi');
var Good = require('good');
var Reptile = require('reptile');
var pack = new Hapi.Pack();
pack.server(8000, { labels: ['web']});
pack.server(8001, { labels: ['admin']});
pack.register(Good, function (err) {});
pack.register(Reptile, function (err) {});
pack.start(function () {
console.log('servers started');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment