Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access api #76

Open
maxcerny opened this issue Apr 25, 2022 · 1 comment
Open

Cannot access api #76

maxcerny opened this issue Apr 25, 2022 · 1 comment

Comments

@maxcerny
Copy link

maxcerny commented Apr 25, 2022

Here is my docker-compose, running on a docker swarm, domain is just a placeholder.

One of the hosts is 172.16.100.56

version: '3.4'

services:
  router:
    image: itzg/mc-router
    ports:
      - 25565:25565
      - 8080:8080
    command: --mapping=domain=test1:25565,domain=test2:25565
    environment:
      API_BINDING: ":8080"
      DEBUG: "TRUE"
  test1:
    image: itzg/minecraft-server
    environment:
      EULA: "TRUE"
  test2:
    image: itzg/minecraft-server
    environment:
      EULA: "TRUE"

A request from the same machine returns:

debian@Docker-Swarm-1:~$ wget 172.16.100.56:8080/routes
--2022-04-25 03:08:49--  http://172.16.100.56:8080/routes
Connecting to 172.16.100.56:8080... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-04-25 03:08:49 ERROR 404: Not Found.

A request from my laptop isn't any better.

Any ideas?

@Anthony-Mariotti
Copy link

You would need to specify the "Accept" header

to file
wget --header="Accept: application/json" 172.16.100.56:8080/routes

or just the response to the console
wget -qO- --header="Accept: application/json" 172.16.100.56:8080/routes

curl (better for query)
curl -w "\n" -H "Accept: application/json" 172.16.100.56:8080/routes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants