title: Express generator and Sequelize to AWS Elastic BeanStalk
body: <p>I made a API express app using express generator and Sequelize ORM, it works great on my local machine using sqlite, I had it deployed on Heroku at one point, but not much for tutorials on how to deploy to AWS Elastic Beanstalk....</p>
  <p><strong>bin/www</strong></p>
  <pre><code>...
  const { sequelize } = require('../models');
  ...
  (async() =&gt; {
    try {
  await sequelize.authenticate();
  await sequelize.sync();
  console.log(`Connection successful!! on port:${port}`)
  
  
  }catch(err) {
    console.log(&quot;Connection failed:&quot;, err)
  }
  }) ();
  </code></pre>
  <p><strong>config/config.json</strong>- <em>this worked  with postgres on heroku at one point</em></p>
  <pre><code>   {
    &quot;development&quot;: {
      &quot;username&quot;: &quot;root&quot;,
      &quot;password&quot;: null,
      &quot;database&quot;: &quot;database_development&quot;,
      &quot;storage&quot; : &quot;GetNailed&quot;, 
      &quot;dialect&quot;: &quot;sqlite&quot;
    },
    &quot;test&quot;: {
      &quot;username&quot;: &quot;root&quot;,
      &quot;password&quot;: null,
      &quot;database&quot;: &quot;database_test&quot;,
      &quot;host&quot;: &quot;127.0.0.1&quot;,
      &quot;dialect&quot;: &quot;mysql&quot;
    },
    &quot;production&quot;: {
      &quot;use_env_variable&quot;: &quot;DATABASE_URL&quot;,
      &quot;dialect&quot;: &quot;postgres&quot;,
      &quot;dialectOptions&quot;: {
        &quot;ssl&quot;: {
          &quot;require&quot;: true,
          &quot;rejectUnauthorized&quot;: false
        }
      }
    }
  }
  </code></pre>
  <p><strong>app.js</strong></p>
  <pre><code>...
  
   const {sequelize} = require('./models')
  
  async function main() {
    await sequelize.sync()
  }
  
  main()
  
  var indexRouter = require('./routes/index');
  var usersRouter = require('./routes/users');
  
  const adminRouter =require('./routes/admin'); 
  const nailsRouter = require('./routes/nails')
  ...
  </code></pre>