Lambda API: v0.3.0 released
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.
javascriptconst 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.
- Breaking Change: Update initialization method 0f79b0d, 1a05b8f
- Add
jsonp
convenience method (#12) d37fa54, 04e21de - Add
cookie
method for setting cookies and added built in cookie parsing (#3) 048ae1a, 9f25b3d, bdd4f4f - Add
clearCookie
method (#4) 9a9ebd3 - Documentation updates e714b53, ad349ab, e22ed79, 21ca353
Full Release Notes: https://github.com/jeremydaly/lambda-api/releases/tag/v0.3.0