diff --git a/README.md b/README.md index 8fd7cb5..1fdbf8d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,30 @@ NOTE: The library is still under development WoT provides a protocol-agnostic architecture that supports an array of standards such as HTTP, WebSockets, MQTT, CoAP, and more, using protocol bindings to decouple application logic from transport-layer specifics. By leveraging widely adopted web standards like JSON, JSON Schema, and Linked Data, WoT ensures data and metadata are both interoperable and semantically rich, enabling intelligent systems to discover, understand, and communicate with Things efficiently. Designed for flexibility, WoT is applicable across a broad spectrum of domains, including AI-driven multi-agent systems, smart homes, and industrial IoT ecosystems. By using the [WoT Scripting API](https://www.w3.org/TR/wot-scripting-api/) you can directly communicate with Things via the Browser. - +## Adding kotlin-wot to Your Gradle Project + +To use **kotlin-wot** in your project, you need to add the required dependencies and configure the repository in your `build.gradle.kts` file. + +```kotlin +plugins { + kotlin("jvm") version "1.9.10" + id("org.springframework.boot") version "3.1.5" + id("io.spring.dependency-management") version "1.1.3" +} + +repositories { + mavenCentral() + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + } +} + +dependencies { + implementation("org.eclipse.thingweb:kotlin-wot-spring-boot-starter:0.1.0-SNAPSHOT") + implementation("org.eclipse.thingweb:kotlin-wot-binding-http:0.1.0-SNAPSHOT") + implementation("org.eclipse.thingweb:kotlin-wot-binding-websocket:0.1.0-SNAPSHOT") +} +``` ## Thing Description (TD) diff --git a/kotlin-wot-spring-boot-starter/src/main/kotlin/spring/HttpProperties.kt b/kotlin-wot-spring-boot-starter/src/main/kotlin/spring/HttpProperties.kt index 10d64ed..eadf0e8 100644 --- a/kotlin-wot-spring-boot-starter/src/main/kotlin/spring/HttpProperties.kt +++ b/kotlin-wot-spring-boot-starter/src/main/kotlin/spring/HttpProperties.kt @@ -7,7 +7,6 @@ package org.eclipse.thingweb.spring import org.springframework.boot.context.properties.ConfigurationProperties -import org.springframework.boot.context.properties.bind.ConstructorBinding import org.springframework.validation.annotation.Validated open class ServerProperties( @@ -23,13 +22,15 @@ open class ServerProperties( class HttpServerProperties( enabled: Boolean = true, host: String = "0.0.0.0", - port: Int = 8080 -) : ServerProperties(enabled, host, port, listOf("http://localhost:$port")) + port: Int = 8080, + baseUrls: List = listOf("http://localhost:$port") +) : ServerProperties(enabled, host, port, baseUrls) @ConfigurationProperties(prefix = "wot.servient.websocket.server", ignoreUnknownFields = true) @Validated class WebsocketProperties( enabled: Boolean = true, host: String = "0.0.0.0", - port: Int = 8080 -) : ServerProperties(enabled, host, port, listOf("ws://localhost:$port")) \ No newline at end of file + port: Int = 8080, + baseUrls: List = listOf("http://localhost:$port") +) : ServerProperties(enabled, host, port, baseUrls) \ No newline at end of file