title: TypeError: server.connection is not a function in Hapi nodejs
body: <p>I started working with Hapi nodejs framework. I am using "hapi@17.2.0" and here is my code in server.js to initiate application.</p>
  
  <pre><code>'use strict';
  
  const Hapi = require('hapi');
  
  const server = new Hapi.Server();
  server.connection({ port: 3000, host: 'localhost' });
  
  server.route({
      method: 'GET',
      path: '/',
      handler: function (request, reply) {
          reply('Hello, world!');
      }
  });
  
  server.start((err) =&gt; {
  
      if (err) {
          throw err;
      }
      console.log(`Server running at: ${server.info.uri}`);
  });
  </code></pre>
  
  <p>After running my project with <code>node server.js</code> from terminal it's throwing error as given below.</p>
  
  <pre><code>/var/www/html/hello_hapi/server.js:6
  server.connection({ port: 3000, host: 'localhost' });
         ^
  
  TypeError: server.connection is not a function
      at Object.&lt;anonymous&gt; (/var/www/html/hello_hapi/server.js:6:8)
      at Module._compile (module.js:612:30)
      at Object.Module._extensions..js (module.js:623:10)
      at Module.load (module.js:531:32)
      at tryModuleLoad (module.js:494:12)
      at Function.Module._load (module.js:486:3)
      at Function.Module.runMain (module.js:653:10)
      at startup (bootstrap_node.js:187:16)
      at bootstrap_node.js:608:3
  </code></pre>