api
Description
The APIProxy extends the serviceProxy with API related functions like OpenAPI support.
Can be used in
Syntax
<api name="string" port="integer" method="[*,POST,PUT,GET,DELETE,TRACE,OPTIONS]" host="[string,*]" ip="[ip]"> <path />? <ssl />? <request> [interceptors]* </request> [interceptors]* <response> [interceptors]* </response> <localhost />? <target />? </serviceProxy>
Listing 1: Syntax
Sample
<api port="2000"> <target url="https://api.predic8.de"/> </api>
Listing 2: Simple forwarding API
<api port="2000"> <openapi location="fruitshop-api.yml"/> </api>
Listing 3: API from OpenAPI description
Attributes
Name | Required | Default | Description | Example |
---|---|---|---|---|
blockRequest | false | false | legacy attribute for usage by Membrane Monitor | |
blockResponse | false | false | legacy attribute for usage by Membrane Monitor | |
externalHostname | false | - | ||
host | false | not set |
A space separated list of hostnames. If set, Membrane will only consider this rule, if the "Host" header of incoming HTTP requests matches one of the hostnames. The asterisk '*' can be used for basic globbing (to match any number, including zero, characters). |
predic8.de *.predic8.de |
ip | false | not set | If present, binds the port only on the specified IP. Useful for hosts with multiple IP addresses. | 127.0.0.1 |
method | false | * | If set, Membrane will only consider this rule, if the method (GET, PUT, POST, DELETE, etc.) header of incoming HTTP requests matches. The asterisk '*' matches any method. | GET |
name | false | By default, a name will be automatically generated from the target host, port, etc. | The name as shown in the Admin Console. | |
port | false | 80 | The port Membrane listens on for incoming connections. | 8080 |