Skip to content

Instantly share code, notes, and snippets.

Created Oct 17, 2017
What would you like to do?
Server startup
'use strict';
const Confidence = require('confidence'),
Glue = require('glue'),
Config = require('./config');
const store = new Confidence.Store(Config),
manifest = store.get('/Glue', { env: process.env.NODE_ENV || 'local' });
const options = {
relativeTo: __dirname,
preRegister: function (server, next) {
// Add the runtime environment to the object. = process.env.NODE_ENV || 'local';
// Add the Confidence store to the object. = store;
Glue.compose(manifest, options, async function (err, server) {
if (err) throw err;
await server.start();
server.log(['startup'], `Hapi server version ${server.version} started at ${}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment