Ktor: Setup subdomain

Created on 17 Apr 2019  路  2Comments  路  Source: ktorio/ktor

Ktor Version

1.1.3

Ktor Engine Used(client or server and name)

ktor-server-netty

JVM Version, Operating System and Relevant Context

JDK 10, Mac OS

I have setup subdomain api.example.com, and now i want my application to handle only this URL. What i need to do to setup ktor for this purpose? I'm new to server development, so im sorry if my question is too stupid :))

question

Most helpful comment

Use host route builder

routing {
    host("api.example.com") {
        // REST
    }
    host("example.com") {
        // web
    }
}

All 2 comments

Use host route builder

routing {
    host("api.example.com") {
        // REST
    }
    host("example.com") {
        // web
    }
}
Was this page helpful?
0 / 5 - 0 ratings