0.0.7 • Published 4 years ago

consume-destination-scp-cf v0.0.7

Weekly downloads
38
License
MIT
Repository
github
Last release
4 years ago

consume-destination-scp-cf

npm Package Build Status Generic badge

NodeJS Module for accessing destination details on SAP Cloud Platform Cloud Foundry stack

Install

npm i consume-destination-scp-cf

Prerequisites

  • Destination service instance created
  • Destination configured
  • All of the above instances bound to the node app, e.g. via manifest.yml:

    applications:
    - name: my_app
      path: my_app
      memory: 128M
      services:
        - destination-instance

Usage

const consumeDestination = require('consume-destination-scp-cf');

// Promise chain
consumeDestination({
        url: '/api/json',
        destinationInstance: 'my-destination-instance',
        destinationName: 'myDestination',
        httpMethod: 'POST',
        payload: {
            "me": "here"
        }
    })
    .then(response => {
        // handle response
    })
    .catch(err => {
        // handle error
    })

API

consume-destination-scp-cf(options)

  • url = Optional, the url to call in the destination, absolute path (including leading slash) e.g. /api/v1/json
  • destinationInstance = Name of the instance of the destination service
  • destinationName = Name of the destination to use
  • httpMethod = HTTP method to use on Destination. Supported GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS.
  • payload = Optional, payload for POST, PUT or PATCH

License

MIT

References

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.2-beta.5

5 years ago

0.0.2-beta.4

5 years ago

0.0.2-beta

5 years ago

0.0.1-beta

5 years ago