Git Product home page Git Product logo

armrest's People

Contributors

andreabogazzi avatar asturur avatar aw avatar cesine avatar dchester avatar dependabot[bot] avatar diversario avatar liquidninja24 avatar mar-kolya avatar richardlitt avatar rubikzube avatar vkajjam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

armrest's Issues

Client http methods should clone args.query before modifying

Modifying args.query directly can cause unintended consequences for the user. For example, if a user is running parallel or in-series calls using the same query object, then deleting fields from this object (see line# 99 in /lib/index.js) will cause subsequent calls to fail.

Configured client ignores path in base URL

I have a client configured like below:

var client = armrest.client({
    base: 'http://www.example.com/api',
});

Then I make a request to /foo:

client.get({
    url: '/foo',
    success: resolve,
    error: reject
});

The full URL that should be constructed is http://www.example.com/api/foo, but the actual URL is http://www.example.com/foo, which is invalid.

I can manually add /api to each request, but the README indicates the base path will be preserved.

Is this a bug, or am I holding it wrong?

Weird error handling for no content responses

Code

var armrest = require('armrest');
var http = require('http');

var client = armrest.client('http://127.0.0.1:8000');

http.createServer(function(req, res) {
  res.writeHead(404);

  if (req.url.match(/empty/)) {
    res.end();
  } else if (req.url.match(/json/)) {
    res.end('{}');
  } else {
    res.end('plain');
  }
}).listen(8000, '127.0.0.1');

client.get({
  url: '/empty',
  complete: function(err) {
    console.log('empty (plain):', err ? 'has error' : 'no error');
  },
});

client.get({
  url: '/json',
  complete: function(err) {
    console.log('empty (json):', err ? 'has error' : 'no error');
  },
});

client.get({
  url: '/',
  complete: function(err) {
    console.log('not empty:', err ? 'has error' : 'no error');
  },
});

Output

$ node test.js
[2014-05-28 10:21:05.856] [WARN] armrest - GET http://127.0.0.1:8000/empty 404 14ms
empty (plain): no error
[2014-05-28 10:21:05.858] [WARN] armrest - GET http://127.0.0.1:8000/json 404 14ms {} | [object Object]
empty (json): has error
[2014-05-28 10:21:05.859] [WARN] armrest - GET http://127.0.0.1:8000/ 404 15ms plain | Error: Could not deserialize data: plain
not empty: has error

Add Changelog

I've been using armrest for a few months and was still on v2.2.2. All of a sudden I noticed this project is at v4.2.1 and I have no idea what was changed, fixed, broken, added in that short amount of time.

Is it possible for you guys to add a Changelog for future releases, so it's much easier to understand without having to view the source code / commit history?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.