docs: included required header for API calls

This commit is contained in:
Geoff Bourne 2021-08-10 16:53:51 -05:00
parent 5fbec98fb6
commit 226f821598
2 changed files with 28 additions and 16 deletions

View File

@ -49,9 +49,12 @@ Routes Minecraft client connections to backend servers based upon the requested
# REST API
* `GET /routes`
* `GET /routes` (with `Accept: application/json`)
Retrieves the currently configured routes
* `POST /routes`
* `POST /routes` (with `Content-Type: application/json`)
Registers a route given a JSON body structured like:
```json
{
@ -59,14 +62,18 @@ Routes Minecraft client connections to backend servers based upon the requested
"backend": "HOST:PORT"
}
```
* `POST /defaultRoute`
* `POST /defaultRoute` (with `Content-Type: application/json`)
Registers a default route to the given backend. JSON body is structured as:
```json
{
"backend": "HOST:PORT"
}
```
* `DELETE /routes/{serverAddress}`
Deletes an existing route for the given `serverAddress`
# Docker Multi-Architecture Image

View File

@ -11,8 +11,13 @@ services:
EULA: "TRUE"
TYPE: FORGE
router:
image: itzg/mc-router
image: ${MC_ROUTER_IMAGE:-itzg/mc-router}
environment:
# enable API
API_BINDING: ":25564"
ports:
- 25565:25565
# bind the API port to only loopback to avoid external exposure
- 127.0.0.1:25564:25564
command: --mapping=vanilla.example.com=vanilla:25565,forge.example.com=forge:25565