4.0.0 • Published 8 years ago

apeman-app-fetch v4.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

apeman-app-fetch

Build Status Code Climate Code Coverage npm Version JS Standard

apeman app to fetch data from another api.

Define res.fetch() method to send another request with HTTP GET method.

Installation

$ npm install apeman-app-fetch --save

Usage

  1. Define an app within Apemanfile.js
  2. Call the app via apeman app command.

Apemanfile.js

/** This is an example Apemanfile to use apeman-app-fetch */

'use strict'

module.exports = {
  $pkg: { /* ... */ },
  $apps: {
    // Define your own app.
    'my-app-01': {
      // Map url and handlers.
      '/': [
        require('apeman-app-fetch')('http://localhsot:3001', {}),
        (req, res, next) => {
          req.fetch('/dos/1', ((data) => {
            /* ... */
            next()
          }))
        }
      ]
    }
  }
}

Then,

$ apeman app my-app-01 -p 3000

Signature

apemanAppFetch(options) -> function

apeman app to fetch data from another api.

Args
NameTypeDefaultDescription
optionsobjectOptional settings.

License

This software is released under the MIT License.

Links

4.0.0

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago