Reference: Storage: HTTP

Installation

dependencies {
    
    implementation(platform("org.http4k:http4k-connect-bom:5.25.1.0"))

    implementation("org.http4k:http4k-connect-storage-http")
}

This storage implementation provides the ability to mount another storage implementation remotely over HTTP inside an OpenAPI compatible server.

You can mount the storage with:

data class AnEntity(val name: String)

val baseStorage = Storage.InMemory<AnEntity>()
baseStorage.asHttpHandler().asServer(SunHttp(8000)).start()

Then simply use your browser to see the OpenAPI specification at http://localhost:8000:

openapi.png