Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 756 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 756 Bytes

argo-connect

An adapter for wrapping connect middleware for use in Argo.

Build Status

Install

npm install argo-connect

Usage

Wrap any connect middleware in the argo-connect adapter.

var argo = require('argo');
var adapter = require('argo-connect');

var middleware = function(req, res, next) {
  res.setHeader('X-Sample-Middleware', 'argo-connect works!');
  next();
};

argo()
  .use(adapter(middleware))
  .get('^/$', function(handle) {
    handle('request', function(env, next) {
      env.response.body = 'Hello World';
      next(env);
    });
  })
  .listen(3000);

License

MIT