Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hapi reply file

Tags:

hapi.js

This code doesn't work in version 9.0.3:

server.route({
    method: 'GET',
    path: '/',
    handler: function() {
        file: 'templates/index.html'

    }
});

Error:

de_modules/hapi/node_modules/hoek/lib/index.js:723
    throw new Error(msgs.join(' ') || 'Unknown error');
          ^
Error: Unknown handler: file

In version 8 it worked well.

like image 680
JAYBEkster Avatar asked Feb 09 '23 06:02

JAYBEkster


1 Answers

I've resolved the problem. From last versions this possiblity was cutted away. After I include "inert" module and registered it, that works fine.

like image 175
JAYBEkster Avatar answered Mar 06 '23 15:03

JAYBEkster