Noah's Pairwise Manifest

    integreat-transporter-http
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.0-alpha.16 • Public • Published

    HTTP transport for Integreat

    Transporter that lets Integreat send and receive data over http/https.

    Getting started

    Prerequisits

    Requires node v10 and Integreat v0.8.

    Installing and using

    Install from npm:

    npm install integreat-transport-http
    

    Example of use:

    const integreat = require('integreat')
    const httpAdapter = require('integreat-transport-http')
    const defs = require('./config')
    
    const resources = integreat.mergeResources(integreat.resources(), {
      transporters: { http: httpAdapter() },
    })
    const great = integreat(defs, resources)
    
    // ... and then dispatch actions as usual

    Example source configuration:

    {
      id: 'store',
      transporter: 'http',
      endpoints: [
        { options: { uri: 'https://api.com/api' } }
      ]
    }

    Data will be sent with content-type application/json.

    An optional logger may be provided to the jsonAdapter() function, to log out the request sent to the service, and its response. The logger must be an object with an info() and an error() function. Both should accept a string message as first argument, and a meta object as the second.

    Running the tests

    The tests can be run with npm test.

    Contributing

    Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests.

    License

    This project is licensed under the ISC License - see the LICENSE file for details.

    Install

    npm i integreat-transporter-http

    DownloadsWeekly Downloads

    46

    Version

    0.1.0-alpha.16

    License

    ISC

    Unpacked Size

    38.3 kB

    Total Files

    25

    Last publish

    Collaborators

    • kjellmorten