Tutorial by Examples

Create a server.js file with the following contents: 'use strict'; const Hapi = require('hapi'); // Create a server instance const server = new Hapi.Server(); // Specify connections (server available on http://localhost:8000) server.connection({ port: 8000 }); // Add a route ...
Parameters can be specified in path property of route configuration 'use strict'; const Hapi = require('hapi'); // Create a server with a host and port const server = new Hapi.Server(); server.connection({ host: 'localhost', port: 8000 }); // Add a route path with url par...
'use strict'; const Hapi = require('hapi'); const Joi = require('joi'); // Create a server with a host and port const server = new Hapi.Server(); server.connection({ host: 'localhost', port: 8000 }); /** * Add a route path with url param */ server.route({ method...

Page 1 of 1