-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathproxies.xml
88 lines (75 loc) · 2.36 KB
/
proxies.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!--
*** Membrane Configuration ***
For more see:
- proxies-*.xml files in this folder
- The examples/* folders with working samples
- Configuration Reference: https://www.membrane-api.io/docs/
Direct Internet access is needed to run this configuration!
Otherwise, see proxies-offline.xml
Use an XML editor with XML Schema syntax completion for easy editing like
Visual Studio Code or Intellij.
-->
<spring:beans xmlns="http://membrane-soa.org/proxies/1/"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://membrane-soa.org/proxies/1/ http://membrane-soa.org/schemas/proxies-1.xsd">
<router>
<!--
Reads the configuration from an OpenAPI document
Open http://localhost:2000/api-doc and use the Swagger UI there
-->
<api port="2000">
<openapi location="fruitshop-api.yml" validateRequests="yes"/>
</api>
<!--
Open http://localhost:2000/names/Paula
See: https://membrane-api.io/tutorials/rest/
-->
<api port="2000">
<path>/names</path>
<rateLimiter requestLimit="3" requestLimitDuration="PT30S"/>
<rewriter>
<map from="^/names/(.*)" to="/restnames/name\.groovy\?name=$1" />
</rewriter>
<response>
<beautifier/>
<log/> <!-- See console for logs -->
<xml2Json/>
<log/>
</response>
<target url="https://api.predic8.de"/>
</api>
<!--
Dump HTTP headers and respond with an error
Open: localhost:2000/header and look at the console
-->
<api name="Groovy" port="2000">
<path>/header</path>
<request>
<groovy>
println "Request headers:"
header.allHeaderFields.each {
print it
}
CONTINUE
</groovy>
</request>
<template contentType="application/json">{ "ok": 1 }</template>
<return statusCode="200"/>
</api>
<!-- Forward all other requests on port 2000 to https://api.predic8.de -->
<api port="2000">
<target url="https://api.predic8.de"/>
</api>
<!--
Administration UI
Open http://localhost:9000
Secure access for production: See proxies-secure-sample.xml
-->
<api name="Console" port="9000">
<adminConsole />
</api>
</router>
</spring:beans>