title: Node.js CouchDB and Nano 'error happened in your connection'
body: <p>I have been looking around for well over 2 hours now trying to find SOMETHING that would give me any kind of direction with this issue but simply cannot find it.</p>
  <p>I am using Node.js and CouchDB with docker-compose. I am also using express and nano. I have stripped my server.js file down to nearly nothing and still keep getting this</p>
  <p><strong>Error:</strong></p>
  <pre><code>/usr/src/app/node_modules/nano/lib/nano.js:137
          reject(new Error('error happened in your connection'))
                  ^
   
  Error: error happened in your connection
      at responseHandler (/usr/src/app/node_modules/nano/lib/nano.js:137:16)
      at /usr/src/app/node_modules/nano/lib/nano.js:427:13
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
   
  Node.js v17.0.1
  </code></pre>
  <p>I have tried about 10 different ways of laying out the <code>url</code> but just cannot get any kind of indication as to why it just will not work. I have tried using <code> curl -X PUT admin:admin@127.0.0.1:5984/posts/&quot;001&quot; -d '{&quot;name&quot;:&quot;Conner&quot;} '</code> and it gets inserted without and issue.</p>
  <p><strong>server.js</strong></p>
  <pre><code>'use strict';
  
  const express = require('express');
  var nano = require('nano')('http://admin:admin@127.0.0.1:5984');
  var posts = nano.use('posts');
  
  const app = express();
  const bodyParser = require(&quot;body-parser&quot;);
  
  const cors =require('cors');
  app.use(cors());
  
  app.use(bodyParser.urlencoded({ 
      extended: true 
  }));
   
  const PORT = 8080;
  const HOST = '0.0.0.0';
  
  
  async function asyncCall() {
    const response = await posts.insert({_id: &quot;001&quot;}, 'rabbit')
    return response
  }
  asyncCall();
  
  app.use('/', express.static('public'));
  console.log('up and running');
  
  
  app.listen(PORT,HOST);
  </code></pre>
  <p><strong>Dockerfile</strong></p>
  <pre><code>FROM node:latest
  
  EXPOSE 8080
  
  WORKDIR /usr/src/app
  
  RUN npm install express --save
  RUN npm install nano --save
  RUN npm install cors --save
  RUN npm install -g loadtest --save
  
  COPY server.js /usr/src/app/server.js
  COPY /public /usr/src/app/public
  
  CMD [&quot;node&quot;, &quot;server.js&quot;]
  </code></pre>
  <p><strong>docker-compose.yml</strong></p>
  <pre><code>version: '3'
  services:
  
   node1: 
    build: ./s1
    depends_on:
     - couchdb1
    container_name: s1a4
    ports:
     - &quot;81:8080&quot;
  
   couchdb1:
    image: couchdb:3.2.0
    container_name:  cdb1
    ports:
      - &quot;5984:5984&quot;
    environment:
      COUCHDB_USER: admin
      COUCHDB_PASSWORD: admin
  </code></pre>