Skip to content

Kotlin Multiplatform wrapper for local HTTP server. Wraps MockWebServer and GCDWebServer under one common interface.

License

Notifications You must be signed in to change notification settings

michallaskowski/mokttp

Repository files navigation

Mokttp

What is it

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.

When it can be useful

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.

How to build and launch samples

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.

Contributing

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.

Roadmap

  • Make sure it works well with Kuiks, and enhance if needs arise.

About

Kotlin Multiplatform wrapper for local HTTP server. Wraps MockWebServer and GCDWebServer under one common interface.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published