Migrating to Claudia 2.0

API Gateway September 2016 update introduced a ton of new features, mostly dependent on the new AWS_PROXY integration type. To get all those benefits, we had to make a backwards-incompatible internal change to Claudia. We’re also using this opportunity to do some house-keeping and drop support for Node 0.10 which is not going to be supported in Lambda any more soon. If you still need to use 0.10 APIs, then use 1.x version of Claudia.

The 2.0 branch is fully backwards compatible with 1.x, so you do not need to make any changes to your code. There are several deprecated features, though, and we will likely be removing them in the next major version (not at least for the next six months). Here is what to use instead:

  api.get('/programmatic-headers', function () {
      return new api.ApiResponse('OK', {'X-Version': '202', 'Content-Type': 'text/plain'});
  }, {success: {headers: ['X-Version', 'Content-Type']}});
  

Just use

  api.get('/programmatic-headers', function () {
      return new api.ApiResponse('OK', {'X-Version': '202', 'Content-Type': 'text/plain'});
  });
  

Did you like this tutorial? Get notified when we publish the next one.

Once a month, high value mailing list, no ads or spam. (Check out the past issues)