Skip to content

Creating two clients re-uses variables from the first client #2

@topfunky

Description

@topfunky

I'm sending a video out to two different clouds using the Node.js client.

When I create a second client, I get an error that the API request wasn't properly signed. It appears that the Panda client is caching variables internally, which makes it impossible to use it twice in an app.

The script works fine if I use either the configuration data from cloudA or from cloudB.

var clientA, clientB, options, panda;

panda = require('panda');

options = {
  source_url:  'http://example.com/my-video.mov',
  payload:     'my-video',
  path_format: 'my-video/:id'
};

clientA = panda.createClient(config['cloudA']);
clientA.post('/videos.json', options, function(response) {
  return console.log(response);
});

// This throws an error about the wrong URL and args. Works fine alone.
clientB = panda.createClient(config['cloudB']);
clientB.post('/videos.json', options, function(response) {
  return console.log(response);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions