title: How to connect to a redis database running in Docker
body: <p>I'm trying to connect to a Redis instance running in Docker mapped to port 6379. I use the Redis library, typescript, and express. However, I do not even get an error. What am I doing wrong?</p>
  <pre><code>import { createClient } from 'redis'
  const redisClient = createClient({ url: &quot;redis://localhost:6379&quot; });
  redisClient.on('error', err =&gt; console.error(err))
  redisClient.once('open', () =&gt; console.log(&quot;Connected to Redis&quot;))
  </code></pre>