Common module for serenity applications.
This module is designed to abstract the partial response support for serenity API's.
It is implemented based on google partial response spec
Install via npm and git
npm install git+
This module has no specific configurations. Application using it have to make sure that they instantiate serenity-datasource module and pass it during this module initialization. If the datasource is invalid error would be thrown
Error conditions has to be handled by application.
var serenityResponseHelper = require('lc1-node-partial-reponse-helper');var serenityDatasource = require('lc1-node-datasource');// For serenity datasource configuration see serenity module docsvar config = require('config');var datasource = new serenityDatasource(config);var partialResponseHelper = new serenityResponseHelper(datasource);
The module exports two functions
This module parse the request query parameters and make it available while reducing object to partial resonse This is added as an middleware to express application usally before any controller logic.
This is also added as an middleware to express application usually just before sendnig the response to client