Join Slack
Powered by
Is it possible to implement an interface to descri...
# ktor
c
crummy
01/16/2021, 9:40 PM
Is it possible to implement an interface to describe my routing in Ktor? (I'd like to share e.g. a UserApi interface between my frontend and backend.)
crummy
01/16/2021, 9:40 PM
With JAX-RS I would do something like this, but not sure how I'd go about this with Ktor:
https://github.com/kylinsoong/jaxrs-examples/blob/master/customer/src/main/java/org/jboss/resteasy/examples/customer/CustomersResource.java
crummy
01/16/2021, 9:51 PM
as far as I can tell this isn't possible. But this feature might solve my problem another way:
https://ktor.io/docs/features-locations.html#building-urls
c
christophsturm
01/16/2021, 10:26 PM
it seems locations is jvm only so you cannot construct a url on your js frontend with it
christophsturm
01/16/2021, 10:28 PM
but something similar when you can define your location data class in common would be great
4
Views
Open in Slack
Previous
Next