hi everyone, this is my first using ktor, I just c...
# server
c
hi everyone, this is my first using ktor, I just cloned this repo https://github.com/ktorio/ktor-http-api-sample from ktor’s docs. after running the project, I see this in terminal window: Application - Responding at http://0.0.0.0:8080, but when I try to access it from browser, it gives me This 127.0.0.1 page can’t be found. does anyone know why, did I miss anything? I tried to use different port and host but still the same result
d
hi, this is by design since this application doesn’t serve any HTML pages but only exposes API endpoints. You can learn how to test these endpoints from this tutorial: https://ktor.io/docs/creating-http-apis.html#manually-testing-http-endpoints
c
hi @duuusha,thank for your response. even if it doesn’t serve HTML page, we can still test GET request in browser, right?
I figured out that I had to register routes in application module to make it accessible
d
yep, you can follow the tutorial to do this, or you can switch to the
final
branch to work with the resulting application. Then, you can run an application, add new customers using
POST
requests, and then you can make
GET
requests to receive these customers