Files
Node.js-14-Cookbook/Chapter08/web-server-hardening/hapi-app/lib/server/routes.js
T
2017-07-31 11:33:31 +05:30

23 lines
419 B
JavaScript

'use strict';
module.exports = function(server) {
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply.view('index');
}
});
server.route({
method: 'GET',
path: '/hello',
handler: function (request, reply) {
const data = {
message1: 'Hello',
message2: 'Paris, France'
};
reply.view('hello', data);
}
});
};