Lambda API: v0.3.0 released

Posted in #lambda-api

A couple of late nights and some research into typical serverless use cases has yielded some pretty cool new features. v0.3 takes another step forward toward becoming a full-featured web framework for serverless applications. ⚡🤘🏻

Breaking Change 😲

There is a breaking change in v0.3 that was necessary to add flexibility with future releases. Lambda API takes advantage of ES6 Classes and was initially requiring the new keyword in order to instantiate an instance. This has been change so that lambda-api now returns a function instead of a Class. This means it can be instantiated in one line now with the ability to pass options as well.

javascript
const api = require('lambda-api')({ version: 'v1.0', base: 'v1' });

If you have functions that are instantiating Lambda API with the new keyword, you will need to either remove new or switch to the one-line instantiation method. I don't expect any more breaking changes before v1.

JSONP Support

You can now use the jsonp() convenience method to return JSON content wrapped in a callback. Support has been added to allow callback specification through a customizable query parameter.

Cookie Support

Lambda API now has convenience methods for setting and clearing cookies. In addition, non-string values are automatically serialized and encoded, allowing you to easily store JSON strings, arrays, and more in cookies. The REQUEST object now has the cookies property that reads, parses, and decodes cookies for you.

Release Notes:

Feature Update

v0.3 of Lambda API adds additional features to handle more serverless application use case including JSONP support and cookie management.

There is also a breaking change in this release that requires a minor update to the way Lambda API is instantiated. This is to ensure future flexibility with the framework.

Full Release Notes: https://github.com/jeremydaly/lambda-api/releases/tag/v0.3.0

NPM: https://www.npmjs.com/package/lambda-api

GitHub: https://github.com/jeremydaly/lambda-api

Comments are currently disabled, but they'll be back soon.