Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Created February 21, 2016 16:43
Show Gist options
  • Save vdeturckheim/9bb12b96421d0867dbe5 to your computer and use it in GitHub Desktop.
Save vdeturckheim/9bb12b96421d0867dbe5 to your computer and use it in GitHub Desktop.
'use strict';
// Hapi framework
const Hapi = require('hapi');
// our plugin in the file api.js
const ApiPlugin = require('./api');
// We create a server object
const server = new Hapi.Server();
// Server will listen on port 8080
server.connection({
port: 8080
});
// register the plugin
server.register(ApiPlugin)
// start the server
.then(() => server.start())
// If th server is correctely started, we log it
.then(() => console.log(`Server running at: ${server.info.uri}`))
// If something wrong happens, we log it
.catch(console.log);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment