what is Ktor how to Start with Ktor ?


In this blog, I will tell you about Ktor and how you can work with it.
What is Ktor?
In easy words, Ktor is a Kotlin framework mostly use to do serverside and clientside for programming. It's a Kotlin web backend framework by which you can write API.
you can also write android app API or web app API with the help of Ktor.

1.Ktor Setup-
*you have to install IntelliJ Ide for the easy  Ktor setup.

*go to setting>plugins.

*Install Ktor and restart Ide you can see Ktor option to create a project.

there you get many predefine templates in Ktor I am choosing static content you can choose any templates.
choose Gradle type first.



choose app engine type for HTTP you can use any of them I am using Netty engine.




Choose Ktor Version for your Project.






it's simply hello world response from API.


How you can connect to the database?

for connecting your app with the database you can use the exposed library which is SQL library by which you can make the connection with SQL through JDBC drivers.
In the next few Blogs I will coverup about connection through the database in Kotline.
you can get more info - CLICK ME

After connection, you can create an API with the help of Ktor Doc.
there are much more to cover up like it is fast can it work better than java framework or not it's a very early stage but definitely, Kotlin has a very bright in terms of serverside or Android app development of Kotline/Native.
Next blog of Kotlin Ktor I will tell How to make a connection with MySQL DB and Kotlin by Exposed library.






Post a Comment

0 Comments