Mokttp is Kotlin Multiplatform wrapper around libraries that are creating a local web server. On Android it wraps OkHttp's MockWebServer, on iOS it's GCDWebServer.
It is not a desired and final solution, since there is an additional setup needed on Kotlin Native for GCDWebServer, and the ideal approach would be to use Ktor Server when it supports platforms other than JVM.
The main goal is to enable mocking and stubbing server response for UI testing, in combination with Kuiks. But if you find having a local HTTP server useful in your app, feel free to use it.
Clone the repo first. The samples contain simple segmented control/radio buttons and a button to make a call to real or mocked servers. Currently it lists contributors from the Kuiks project, which can be also provided by a local HTTP server.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update samples as appropriate.
- Make sure it works well with Kuiks, and enhance if needs arise.