title: Heroku Application error: An error occurred in the application and your page could not be served
body: <p>I'm building an app and I've gotten to the point where deployment to HEROKU was successful. On opening app(<a href="https://odm-mobile.herokuapp.com/" rel="nofollow noreferrer">https://odm-mobile.herokuapp.com/</a>), I get APPLICATION ERROR, I checked log with CLI command and this is what I get: </p>
  
  <pre><code>2018-10-22T09:06:32.000000+00:00 app[api]: Build started by user aailoje@gmail.com
  
  2018-10-22T09:06:45.572183+00:00 app[api]: Deploy 7bc663ae by user aailoje@gmail.com
  
  2018-10-22T09:06:45.572183+00:00 app[api]: Release v24 created by user aailoje@gmail.com
  
  2018-10-22T09:06:45.826688+00:00 heroku[web.1]: State changed from crashed to starting
  
  2018-10-22T09:06:47.000000+00:00 app[api]: Build succeeded
  
  2018-10-22T09:06:49.116924+00:00 heroku[web.1]: Starting process with command `npm start`
  
  2018-10-22T09:06:53.099327+00:00 app[web.1]:
  
  2018-10-22T09:06:53.099345+00:00 app[web.1]: &gt; odm-mobile@1.0.0 start /app
  
  2018-10-22T09:06:53.099347+00:00 app[web.1]: &gt; node index.js
  
  2018-10-22T09:06:53.099349+00:00 app[web.1]:
  
  2018-10-22T09:06:53.840102+00:00 heroku[web.1]: Process exited with status 0
  
  2018-10-22T09:06:53.856482+00:00 heroku[web.1]: State changed from starting to crashed
  
  2018-10-22T09:06:53.858384+00:00 heroku[web.1]: State changed from crashed to starting
  
  2018-10-22T09:06:57.152906+00:00 heroku[web.1]: Starting process with command `npm start`
  
  2018-10-22T09:07:00.298331+00:00 app[web.1]:
  
  2018-10-22T09:07:00.298348+00:00 app[web.1]: &gt; odm-mobile@1.0.0 start /app
  
  2018-10-22T09:07:00.298350+00:00 app[web.1]: &gt; node index.js
  
  2018-10-22T09:07:00.298351+00:00 app[web.1]:
  
  2018-10-22T09:07:00.979144+00:00 heroku[web.1]: Process exited with status 0
  
  2018-10-22T09:07:00.997278+00:00 heroku[web.1]: State changed from starting to crashed
  
  2018-10-22T09:07:20.183091+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=odm-mobile.herokuapp.com request_id=c9a8b164-2f61-459b-87da-56518ce4dc81 fwd="154.120.97.254" dyno= connect= service= status=503 bytes= protocol=https
  
  2018-10-22T09:07:22.293716+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=odm-mobile.herokuapp.com request_id=6870b281-7607-4882-8bac-e97c38169e26 fwd="154.120.97.254" dyno= connect= service= status=503 bytes= protocol=https
  
  2018-10-22T09:25:14.164205+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=odm-mobile.herokuapp.com request_id=af0d9ab3-8a64-494e-8b2e-4b5e0a46f7fd fwd="154.120.97.254" dyno= connect= service= status=503 bytes= protocol=https
  
  2018-10-22T09:25:15.783603+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=odm-mobile.herokuapp.com request_id=dcd6cc6f-0959-4ca7-b4d4-43143e952b8c fwd="154.120.97.254" dyno= connect= service= status=503 bytes= protocol=https`
  </code></pre>
  
  <p>The following are the files that I'm working with on dreamweaver</p>
  
  <ol>
  <li><p>index.js
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var port = Number(process.env.PORT|| 5000);
  var express = require('express'),
      moment = require('moment');
  
  var exports = module.exports = function(dir, options) {
      var modules = {};
      options = merge(options || {}, {
          lazy: true
      });
  
      fs.readdirSync(dir).forEach(function(filename) {
          // filter index and dotfiles
          if (filename !== 'index.js' &amp;&amp; filename[0] !== '.') {
              var moduleName = path.basename(filename, path.extname(filename));
              var modulePath = path.join(dir, moduleName);
              // lazy load
              if (options.lazy) {
                  Object.defineProperty(modules, moduleName, {
                      get: function() {
                          return require(modulePath);
                      }
                  });
              } else {
                  modules[moduleName] = require(modulePath);
              }
          }
      });
  
      return modules;
  };</code></pre>
  </div>
  </div>
  </p></li>
  <li><p>package.json
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{
    "name": "odm-mobile",
    "version": "1.0.0",
    "description": "odm daily devotional",
    "main": "index.js",
    "scripts": {
      "start": "node index.js"
    },
    "keywords": [],
    "author": "xdoshent &lt;aailoje@gmail.com&gt;",
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "odm-mobile"
    },
    "dependencies": {
      "@fortawesome/fontawesome-free": "^5.4.1",
      "express": "^4.16.4",
      "index.js": "0.0.3",
      "moment": "^2.22.2",
      "packages": "0.0.8"
    },
    "engines": {
      "node": "8.12.0",
      "engines": {
        "npm": "6.4.1"
      }
    }
  }</code></pre>
  </div>
  </div>
  </p></li>
  <li><p>Procfile
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>web: node index.js</code></pre>
  </div>
  </div>
  </p></li>
  </ol>
  
  <p>Pls clearly point out the issues I might be having and errors in the files I'm working with as I'm new to all these </p>