dacap

pipeline status coverage report

Dynamic And Compressing Api Proxy is a service which lets you proxy arbitrary API-Endpoints which are by themself to slow to be used in production environments. All cached Responses are held in memory, so be sure to provide enough.

Requirements

local Execution

Installation

$# npm install -g @ubleipzig/dacap

Execution

$# dacap

as Container

$# docker run -p 3000:3000 -v /my/hosts/data/folder:/data ubleipzig/dacap

You can customize multiple values, see Advanced Configuration

Usage

After Start the Admin-Interface is available under http://localhost:3000/admin.

First of all one has to define a Cache where the requests to an API-Endpoint are stored. This is done from within the Admin Interface.

One has to define the URL to the desired API-Endpoint (e.g. http://foo.example.com/) and a Cache-Name for this API-Endpoint (e.g. foo).

All API-Requests which normally would go to

http://foo.example.com/?query=foo&offset=0&limit=10

now you can request by accessing

http://localhost:3000/ep/foo/?query=foo&offset=0&limit=10

Advanced Configuration

The service can be configured by environment variables. The following are available:

Only when both user and password are specified basic-auth is enabled