title: Express.js net::ERR_CONNECTION_CLOSED
body: <p>I'm running a Universal Javascript application on Heroku.</p>
  
  <p>My Vue.js app is being loaded by Express.js and requests are proxied to <code>https://localhost:3000/api</code>. </p>
  
  <p>I am trying to make a simple POST request to an endpoint, however the console on Chrome prints out:</p>
  
  <p><code>OPTIONS https://localhost:3000/api net::ERR_CONNECTION_CLOSED</code></p>
  
  <p>Here is my express server:</p>
  
  <pre><code>import express from 'express'
  import cors from 'cors'
  import bodyParser from 'body-parser'
  import path from 'path'
  import mongoose from 'mongoose'
  import routes from './routes'
  
  mongoose.connect('mongodb://coolAddress');
  var db = mongoose.connection;
  db.on('error', console.error.bind(console, 'connection error:'));
  db.once('open', () =&gt; {
    console.log("mongoose connected")
  })
  
  const app = express()
  
  const port = 3000
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(cors())
  app.use(express.static(path.resolve(__dirname, '../coolClient/dist')));
  
  app.use('/api', routes)
  
  app.all('*', (req, res) =&gt; {
    res.sendFile(path.resolve(__dirname, '../coolClient/dist', 'index.html'));
  })
  
  app.listen(process.env.PORT || port, () =&gt; {
    console.log(`App listening on ${process.env.PORT || port}`)
  })
  </code></pre>
  
  <p>I suspect this may have to do with SSL configuration. Googling the issue brings that possibility up, but doesn't provide much of an approach to debug it.</p>
  
  <p>Any ideas?</p>