From the course: Transitioning from Java to Kotlin
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Testing your local service
From the course: Transitioning from Java to Kotlin
Testing your local service
- [Instructor] Now that we've got our first REST endpoint defined, how can we easily deploy and test our Ktor service? Let's learn to deploy our service locally so we can quickly make changes to and test our application. Now deploying our service to a locally running server is thankfully quite easy. We can open our Application.kt file and navigate to the main function. You should see a green run icon next to that method. Clicking on that button should click off the deployment of the service. If we view the output of the run tool window, we should see that at the end a message that says ktor.application responding at, and it likely is responding at local host 8080. If we click on this URL, we should be opened up into a web browser and that browser likely then is showing an error. Why do you think that is? If you said that it's because we didn't define a root route for our service, you are correct. If we open back to…
Contents
-
-
-
-
-
-
-
(Locked)
Creating a new Ktor project6m 30s
-
(Locked)
Adding your first route5m 33s
-
(Locked)
Testing your local service6m 41s
-
(Locked)
Adding status pages7m 32s
-
(Locked)
Storing a list of products5m 42s
-
(Locked)
Returning typed responses11m 57s
-
(Locked)
Adding new products5m 38s
-
(Locked)
Authenticating routes7m 57s
-
(Locked)
Challenge: Return all active orders1m 35s
-
(Locked)
Solution: Return all active orders7m 4s
-
(Locked)
-