Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('registers the vision plugin', async () => {
// setup
server = Hapi.server();
server.register(Logger);
// exercise
await server.register(Views);
// validate
expect(server.registrations.vision).to.be.an.object();
expect(server.decorations.toolkit).to.contains('view');
});
var hapi = require('hapi');
var routes = require('./routes');
var config = {cors: true};//, docs: true };
var server = new hapi.Server('localhost', 7777, config); // 8080 is the port to listen on
server.route(routes);
server.start(function() {
console.log('Server started at: ' + server.info.uri);
});
var Hapi = require('hapi');
var server = new Hapi.Server();
var port = process.env.PORT || 5000; // let heroku or env set port number
server.connection({ port: port });
server.route([{ method: '*', path: '/{param*}', handler: { directory: { path: __dirname +'/../' } } } ]);
server.start(function() { console.log('Static Server Listening on: http://127.0.0.1:' +port) });
hapi: (config, port) => new Promise((resolve) => {
var grant = Grant.hapi()(config)
var server = new Hapi.Server()
server.connection({host: 'localhost', port})
server.route({method: 'GET', path: '/', handler: callback.hapi})
server.register([
{register: grant},
{register: yar, options: {cookieOptions:
{password: '01234567890123456789012345678912', isSecure: false}}}
],
() => server.start(() => resolve({grant, server})))
}),
'hapi-prefix': (config, port) => new Promise((resolve) => {
beforeEach(function () {
server = new Hapi.Server({ debug: false })
server.connection({
host: HOSTNAME,
port: PORT,
})
})
before('start server', function (done) {
server = new Hapi.Server();
server.connection({
port: 3192
});
done();
});
before('start server', function (done) {
server = new Hapi.Server();
server.connection({
port: 3192
});
done();
});
lab.beforeEach(function(done){
server = new hapi.Server();
server.connection();
server.route(routes);
done();
});
beforeEach((done) => {
server = new Hapi.Server();
server.connection();
return done();
});
beforeEach((done) => {
server = new Hapi.Server();
server.connection();
return done();
});