title: Can I pass multiple functions to an http.createServer in NodeJS?
body: <p>I'm completely new to server development and NodeJS, so my apologies if this question sounds stupid or if such a question already exists.</p>
  
  <p>I was following a simple NodeJS tutorial and building a simple "Hello World" server. I noticed that <code>http.createServer</code> took only one function as its argument.</p>
  
  <pre><code>http.createServer(function(req,res) {
   res.writeHead(200, {'Content-Type' : 'text/html'});
   res.end("Hello World");
  }.listen(8080);
  </code></pre>
  
  <p>I tried passing another function to it like the following: </p>
  
  <pre><code>var http = require('http');
  
  http.createServer(function(req,res) {
      res.writeHead(200, {'Content-Type':'text/html'});
      res.end("Hello World");
  },
  function (req, res) {
      res.write("Blahblah");
      res.end();
  }
  ).listen(8080);
  </code></pre>
  
  <p>But hitting <code>localhost:8080</code> returned only Hello World.</p>
  
  <p>So I was wondering if I could pass multiple functions to it and if not, then why.</p>
  
  <p>Thank you for your time</p>