amino-driver-http

0.4.1 • Public • Published

amino-request-http allows you to use HTTP as a transport for amino requests.

Usage

serve-sprocket.js

// Create a sprocket service.
var amino = require('amino');

amino.respond('sprockets', function(router, spec) {
  // router is a director router.
  // @see https://github.com/flatiron/director
  router.get('/:id', function(id) {
    // amino adds the helpers json(), text(), and html().
    this.res.json({id: id});
  });
});

get-sprocket.js

// Request a sprocket from the sprocket service.
var amino = require('amino');

// amino.request() is the same as github.com/mikeal/request, except
// it can handle the amino:// protocol, which uses virtual hosts defined
// with amino.respond().
amino.request('amino://sprockets/af920c').pipe(process.stdout);

Readme

Keywords

none

Package Sidebar

Install

npm i amino-driver-http

Weekly Downloads

4

Version

0.4.1

License

none

Last publish

Collaborators

  • carlos8f