TheHorizian

Ktor for Mobile Developers: Is it Easy to Learn Server Side Coding? Part-1

Backend for mobile engineers with Kotlin and Ktor

Ktor is an asynchronous framework for creating microservices, web applications, and more. It’s fun, free, and open source.

The project structure directory
dependencies {
implementation “io.ktor:ktor-server-core:$ktor_version”
implementation “io.ktor:ktor-server-netty:$ktor_version”
implementation “ch.qos.logback:logback-classic:$logback_version”
implementation “io.ktor:ktor-serialization:$ktor_version”
testImplementation “io.ktor:ktor-server-tests:$ktor_version”
}
To start the server click on run button.
2021–03–25 14:13:28.803 [main] INFO Application — Autoreload is disabled because the development mode is off.2021–03–25 14:13:29.156 [main] INFO Application — Responding at http://0.0.0.0:8080
This localhost page can’t be found
fun Application.module(testing: Boolean = false) {
routing {
get("/") {
call.respondText("HELLO WORLD!", contentType = ContentType.Text.Plain)
}
/*---------------------*/
post { }
put { }
delete { }
}

}

--

--

Android Developer | Kotlin Developer | Open-Source Enthusiast | Part-time Blogger | 💻 🚘 🎸 enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Manish Agnihotri

Android Developer | Kotlin Developer | Open-Source Enthusiast | Part-time Blogger | 💻 🚘 🎸 enthusiast