Skip to content

No Longer works with Hapi 9.3.1 #12

@dp1140a

Description

@dp1140a

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions