-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hapi 9.3.1 requires that the Inert plugin be manually included for static content. This breaks grunt-hapi which now gives the error:
Fatal error: Hapi ["/Users/dpatton/Documents/Git/HDFS-Viz/server/server.js"] - Error: Missing required start callback function
Here is the relevant section of my server file
const Hapi = require('hapi'); //http://hapijs.com/api
const inert = require('inert');
const server = new Hapi.Server();
server.connection({
host: config.server.host,
address: config.server.host,
port: config.server.port
});
server.register(inert, function (err) {});
server.route({
method: 'GET',
path: '/{param*}',
handler: {
directory: {
path: process.cwd() + '/app',
index: true
}
}
});
/** Other routes ... **/
/***********************
Server Start
***********************/
server.start(function (err) {
if (err) {
log.error(err);
}
log.info('Server running at ' + server.info.uri);
});
module.exports = server;