Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Hapi = require('hapi');
var path = require('path');
var server = Hapi.createServer('localhost', Number(process.argv[2] || 8080));
server.route({
method: 'GET',
path: '/',
handler: {
file: path.join(__dirname, '/index.html')
}
});
server.start();
var Hapi = require("hapi");
var server = Hapi.createServer("localhost", Number(process.argv[2] || 8080));
server.route({
method: 'GET',
path: '/',
handler: function (req, reply) {
reply("Hello Hapi");
}
});
server.start();
var Hapi = require("hapi");
var server = Hapi.createServer("localhost", Number(process.argv[2] || 8080));
server.route({
method: 'GET',
path: '/{name}',
handler: function (request, reply) {
reply("Hello " + request.params.name);
}
});
server.start();
var Hapi = require('hapi'),
path = require('path');
var server = Hapi.createServer("localhost", Number(process.argv[2] || 8080));
server.route({
method: "GET",
path: "/",
handler: {
file: path.join(__dirname, "/index.html")
}
});
server.start();
'use strict';
var Hapi = require('hapi');
var server = Hapi.createServer('localhost', process.argv[2] || 8080);
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello Hapi');
}
});
server.start();