Skip to content

Instantly share code, notes, and snippets.

@WesTyler
Created November 1, 2017 20:03
Show Gist options
  • Save WesTyler/eee7309476697af5437c7fb94fa36531 to your computer and use it in GitHub Desktop.
Save WesTyler/eee7309476697af5437c7fb94fa36531 to your computer and use it in GitHub Desktop.
const manifest = {
server: {
cache: 'redis'
},
connections: [
{
port: 8000,
labels: ['web']
},
{
port: 8001,
labels: ['admin']
}
],
registrations: [
{
plugin: {
register: './assets',
options: {
uglify: true
}
}
},
{
plugin: './ui-user',
options: {
select: ['web']
}
},
{
plugin: {
register: './ui-admin',
options: {
sessiontime: 500
}
},
options: {
select: ['admin'],
routes: {
prefix: '/admin'
}
}
},
{
plugin: {
register: require('./awesome-plugin.js'),
options: {
whyNot: true
}
}
},
]
};
const options = {
relativeTo: __dirname
};
Glue.compose(manifest, options, (err, server) => {
if (err) {
throw err;
}
server.start(() => {
console.log('hapi days!');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment