title: AWS lambda: "Handler 'handle' missing on module 'exports'"
body: <p>I have uploaded a <code>node js</code> express project to <code>AWS lambda</code>. The following is my handler code saved as <code>exports.js</code>:</p>
  
  <pre><code>const
    express = require('express'),
    bodyParser = require('body-parser'),
    request = require('request'),
    app = express().use(bodyParser.json()); // creates express http server
  
  exports.handler = function(callback){
      request('http://localhost/php-rest/api.php/routes?filter=route_short_name', function(error, response, body) {
          if (!error &amp;&amp; response.statusCode == 200) {
              message = JSON.stringify(JSON.parse(body));
              return callback(message, false);
          } else {
              return callback(null, error);;
          }
      });
  }
  
  app.get('/exports.handler', function(req, res) {
  
      exports.handler(function(err, data){
          if(err) return res.send(err);
          res.send(data);
      });
  
  });
  </code></pre>
  
  <p>The handler code is separate from my <code>app.js</code> file. I got the following error when I tested it on aws lambda:</p>
  
  <pre><code>{
    "errorMessage": "Handler 'handler' missing on module 'exports'"
  } 
  </code></pre>