'use strict';

var Hapi = require('hapi');
var plugin = require('./plugin');
var os = require('./os');

exports.server = function(name) {
  var server = new Hapi.Server();
  server.register({
    register: plugin,
    options: {
      host: os.hostname(),
      port: 3000,
      name: name
    }
  }, (err) => {
    if (err) {
      console.error('Failed to load plugin:', err);
    }
  });

  server.connection({port: 3000});
  return server;
};

@@ -32,24 +32,49 @@
 re('hapi');%0A
+var os = require('os');%0A%0A
 var plugin =
@@ -98,34 +98,8 @@
 n');
-%0Avar os = require('./os');
 %0A%0Aex

fix os require