title: Apollo Server network error: unable to reach server
body: <p>I'm trying to develop a backend with Apollo Server, I have enabled cors in my browser and tried adding the <code>cors: {origin: true}</code> configuration in the server. I have included the server code below.</p>
  <p>Hopefully someone is able to spot what I messed up on.</p>
  <pre><code>// index.js
  const {ApolloServer} = require('apollo-server')
  const typeDefs = require('./schema')
  const resolvers = require('./resolvers')
  const CourseAPI = require('./sources')
  
  const apollo = new ApolloServer({
    typeDefs,
    resolvers,
    cors: {
      origin: true
    },
    dataSources: () =&gt; {
      return {
        courseAPI: new CourseAPI({
          client: 'pg',
          connection: {
            host: 'ec2-79-125-30-28.eu-west-1.compute.amazonaws.com',
            user: 'hgsfclebwdvtrz',
            password:
              '975260d79ace6b3f78132e6d51f8f56612e6cbc24c8d6063b9c6be60f5160453',
            database: 'd7jasm9tcmpc30'
          }
        })
      }
    }
  })
  
  apollo.listen().then(({url}) =&gt; {
    console.log(` Server ready at ${url}`)
  })
  </code></pre>