1.0.20 • Published 6 years ago

kong-admin-node-client v1.0.20

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

NPM Version Build Status Test Coverage NPM Downloads MIT License

kong admin client API

Client API for configuring Kong admin.

Supported features

  • Adding APIs
  • Adding Plugins per API
  • Adding plugins in root (for all APIs)

Road map

  • Implementing all Kong Admin APIs
  • Adding UT coverage

Installation

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install kong-admin-client --save

Usage

let KongAPI = require('kong-admin-node-client');

let kongAPI = new KongAPI({
    kong_config: {
        "kong_admin_api_url": "http://mky-kong:8001",
        "apis": [{
            "name": "myApp",
            "uris": "/path/",
            "upstream_url": "http://my-upstream-url.com",
            "plugins": [{
                "name": "rate-limiting",
                "config": {
                    "second": "5",
                    "hour": "10000"
                }
            }]
        }],
        "root_plugins": [{
            "name": "request-termination",
            "config": {
                "status_code": 403,
                "message": "So long and thanks for all the fish!"
            }
        }]
    },
    headers:  {}, //headersObj,
    headers_to_mask: ['maskHeader1', 'maskHeader2'] // array of fields the logger should mask. 
});


kongAPI.createConfigurations()
    .then((result) => {
        // Success
    })
    .catch((err) => {
        // Failure
    });

Note

per each function (createApis,getAPIs,removeAPIs,removePlugins,createPlugins,getPluginsOfExistApi) headers object can be sent, which will override the headers provided in the constructor (if any).

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago