Skip to content

Commit f04fc2b

Browse files
committed
adding GET /services.json docs
1 parent cf4296b commit f04fc2b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ service.start(3000)
5555
pathRegex: '/*',
5656
// route prefix
5757
prefix: '/public',
58+
// Optional documentation configuration (unrestricted schema)
59+
docs: {
60+
name: 'Public Service',
61+
endpoint: '/api-docs',
62+
type: 'swagger'
63+
},
5864
// Optional "prefix rewrite" before request is forwarded. Default value: ''
5965
prefixRewrite: '',
6066
// Remote HTTP server URL to forward the request
@@ -104,6 +110,26 @@ const onResponse = async (req, res, stream) => {
104110
}
105111
}
106112
```
113+
## The "*GET /services.json*" endpoint
114+
Since version `1.3.5` the gateway exposes minimal documentation about registered services at: `GET /services.json`
115+
116+
Example output:
117+
```json
118+
[
119+
{
120+
"prefix":"/public",
121+
"docs":{
122+
"name":"Public Service",
123+
"endpoint":"/swagger.json",
124+
"type":"swagger"
125+
}
126+
},
127+
{
128+
"prefix":"/admin"
129+
}
130+
]
131+
```
132+
> NOTE: Please see `docs` configuration entry explained above.
107133
108134
## Gateway level caching
109135
Caching support is provided by the `http-cache-middleware` module. https://www.npmjs.com/package/http-cache-middleware

0 commit comments

Comments
 (0)