fleek-response is utility module for the fleek framework handling user responses
JavaScript
Latest commit d830ec0 Aug 23, 2016 @johnhof johnhof committed on GitHub Merge pull request #8 from johnhof/master
updated depencies
Permalink
Failed to load latest commit information.
lib
tests
README.md
package.json

README.md

Fleek Response

Response module that must be used with fleek router or fleek web socket.

Quick reference:

Usage

  //using a option parameter in generic koa-app
  ...
  var flr = require('fleek-router');

  flr(app, { response : true });

  //using within fleek-router

  var fleekResponse = require("fleek-response");
  var route         = require("koa-router");

  ...

  //psuedocode for using fleek response as middleware
  var sampleRouter = new route['GET'](path, bindRouteData, fleekResponse, middleware);


  //----------------------------------------------------------------------------

  //using with fleek-ws (fleek web socket)

  var fleekResponse = require("fleek-response")('socket');
  var parser        = require('fleek-parser');

  //parse document as json object
  var swagger = parser.parse(docs);

  var responsesHandler = fleekResponse(swagger);

  responsesHandler contain object that load up swagger schema as default response body

Tip

  • For deeper understanding the use of fleek response, please study fleek-router, and fleek-ws implementation

Authors