Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4620130
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:31:07+00:00 2026-05-22T02:31:07+00:00

Beginner Question. Below is an example given on the Cradle CouchDB documentation: https://github.com/cloudhead/cradle What

  • 0

Beginner Question.

Below is an example given on the Cradle CouchDB documentation:
https://github.com/cloudhead/cradle

What is http://living-room.couch?

What is 5984?

new(cradle.Connection)('http://living-room.couch', 5984, {
    cache: true,
    raw: false
});

I’m trying to get info from my couchdb:

url: subdomain.mywebsite.com

node port: 12345

couchdb port: 67891

I’ve tried different ways to connect using the above code, but I get the below error.

What is the right way to connect?

17 May 09:50:57 - [nodemon] restarting due to changes...
17 May 09:50:57 - [nodemon] ./test_couch.js


17 May 09:50:57 - [nodemon] starting node
Server running somewhere
request starting...
request starting...


node.js:181

        throw e; // process.nextTick error, or 'error' event on first tick


^
Error: ECONNREFUSED, Connection refused
    at Socket._onConnect (net.js:602:18)
    at IOWatcher.onWritable [as callback] (net.js:186:12)

17 May 09:51:05 - [nodemon] app crashed - waiting for file change before starting...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:31:07+00:00Added an answer on May 22, 2026 at 2:31 am

    From the same documentation that you posted a link to, but only in the code folder here in this JS file https://github.com/cloudhead/cradle/blob/master/lib/cradle.js

    cradle.Connection = function Connection(/* variable args */) {
    var args = Array.prototype.slice.call(arguments),
        host, port, remote, auth, options = {};
    
    args.forEach(function (a) {
        if (typeof(a) === 'number' || (typeof(a) === 'string' && /^\d{2,5}$/.test(a))) {
            port = parseInt(a);
        } else if (typeof(a) === 'object') {
            options = a;
            host = host || options.host;
            port = port || options.port;
            auth = options.auth;
        } else {
            host = a;
        }
    });
    

    So it takes whatever parameters you give it, and slices it into an array.

    What is 5984?

    It’s the port to connect to, as evinced by this code snippet I shared.

    It accepts really three types of parameters, a port (between 2 and 5 digits in length) number, a string, and an object for configuration.

    You could supply just one object and declare the parts of it as this:

    new(cradle.Connection)({
      host: 'http://living-room.couch',
      port: 67891,
      cache: true,
      raw: false
    });
    

    and it would work the same

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple R beginner's question: How do I express the sum below
This is a pretty beginner question, but given that I render a complex shape
Beginner question. My goal is to add documents to my CouchDB database on a
VS beginner question. How to change parent control of a control? Example. I have
I think this is probably a beginner question about big-O notation. Say, for example,
A beginner question, bear with me: I'm just wondering under what circumstances one should
A beginner's question. I'm building a .swf with Flex Ant. To my .swf I
Once again a very beginner-ish question, but here I go: I would like to
I am a beginner of python and have a question, very confusing for me.
Once more here I come with a question of s2, I'm a beginner at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.