Send requests to local HTTP servers (http.Server, express, connect or a function) with superagent
Send requests to local HTTP servers (http.Server, express, connect or a function) with superagent.
Inspired by supertest's
superagent packages from npm.
The superagent package should be installed alongside appagent
(it is not installed as a dependency of appagent - it expects it to
already be installed by a parent package).
$ npm install appagent superagent
var appagent = require'appagent'app = require'express';// Without installingvar request = appagentapp;requestget'/' ;requestpost'/'end ;// Install as a `client` property of an appappagentinstallapp;appclientput'/' ;// Or install globally on http.Server prototype, to make it available// on all appsappagentinstall;