appagent

Send requests to local HTTP servers (http.Server, express, connect or a function) with superagent

Usage no npm install needed!

<script type="module">
  import appagent from 'https://cdn.skypack.dev/appagent';
</script>

README

appagent

Send requests to local HTTP servers (http.Server, express, connect or a function) with superagent.

Inspired by supertest's request(app).method() API.

Install

$ npm install appagent

Usage

var appagent = require('appagent')
  , app = require('express')();

// Without installing
var request = appagent(app);
request.get('/', function(err, res) { ... });
request.post('/').end(function(err, res) { ... });

// Install as a `request` property of an app
request.install(app);
app.request.put('/', ...);

// Or install globally on http.Server prototype
request.install();

License

MIT