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

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