i have routes in a seperate file and set up the config to load it
Copy code
@Suppress("unused")
fun Application.routes() {
routing {
...
}
}
and add it to the ktor.application.modules in the application.conf
i
Ian
07/05/2018, 10:55 PM
Hmm, yeah - but I’m not sure that would change anything material - it just seems like a different way to organize the code.
What’s infuriating is that this works just fine in my actual code - it’s just this test code I’m trying to use, which is super-simple and copied verbatim from the documentation - doesn’t work.
n
Nikky
07/05/2018, 11:13 PM
well there is something not registering the routes i think
does your actual code use the integrated netty ?
i
Ian
07/05/2018, 11:45 PM
Yes, in both cases I’m using the integrated Netty, this is the code verbatim:
Copy code
val s = embeddedServer(Netty, port = 8080) {
routing {
get("/") {
call.respondText("Hello World!", ContentType.Text.Plain)
}
get("/demo") {
call.respondText("HELLO WORLD!")
}
}
}
s.start(wait = true)