0.2.0 • Published 7 years ago

hapi-kong-endpoints v0.2.0

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
7 years ago

hapi-kong-endpoints

Allow Hapi to register itself automatically on an Kong Server Endpoints

usage

server.register({
    register : require('hapi-kong-endpoints'),
    options     : {
        kong : {
            host        : 'https://kong:8001',
            username    : 'user',
            password    : 'password'
        },
        endpoint : {
            name                : 'my-api',
            requestPath         : '/api',
            stripRequestPath    : true,
            upstreamUrl         : 'http://192.168.10.10:8080'
        }
    }
}, (err) => {
    
});

options

paramdescriptionrequired
kongKong connection informationsx
kong.hostAdmin API Server (E.g : http://kong:8001)x
kong.usernameAdmin API username
kong.passwordAdmin API password
endpointKong endpoint informationsx
endpoint.nameEntry Point Name. Must be an [a-zA-Z0-9_\-] Stringx
endpoint.requestHostThe public DNS address that points to your API. For example, mockbin.com
endpoint.requestPathThe public path that points to your API. For example, /someservice
endpoint.stripRequestPathStrip the request_path value before proxying the request to the final API. For example a request made to /someservice/hello will be resolved to upstream_url/hello. By default is false.
endpoint.preserveHostPreserves the original Host header sent by the client, instead of replacing it with the hostname of the upstream_url. By default is false.
endpoint.upstreamUrlThe base target URL that points to your API server, this URL will be used for proxying requests. For example, https://mockbin.comx