Amaan
05/20/2022, 1:20 AMfun Application.configureRouting() {
routing {
host("localhost:8080") {
home()
}
host("chat.localhost:8080") {
chat()
}
}
}
but that doesn't seem to work when I test it on my browser.Aleksei Tirman [JB]
05/20/2022, 9:55 AMhost
method or remove it from the first argument.Amaan
05/20/2022, 6:32 PMval host = environment.config.host
val port = environment.config.port
routing {
host(host, port) {
home()
}
host("chat.$host", port) {
chat()
}
}
and in application.conf
I have
ktor {
deployment {
host = localhost
...
When I run a docker container, I can't access the localhost of the container from my localhost endpoint (I put in chat.localhost:8080
, but I can't get access to the one in the container). However, when I just run Main.kt
, it works just fine. The reason I want to use a container is so I can host it online and make sure the subdomains work there too.
Removing the host name from the application.conf
works to access 0.0.0.0:8080
, but then I can't access the chat
subdomain.