diff --git a/api/build.gradle.kts b/api/build.gradle.kts index f261a97..f51dd4f 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -17,10 +17,14 @@ repositories { } val kotlinVersion: String by rootProject.extra +val ktorVersion = "1.6.1" dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") + implementation("io.ktor:ktor-server-core:$ktorVersion") + implementation("io.ktor:ktor-server-cio:$ktorVersion") + implementation("ch.qos.logback:logback-classic:1.2.3") implementation("org.springframework.boot:spring-boot-starter-data-jpa") implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.session:spring-session-jdbc") diff --git a/api/src/main/kotlin/com/wbrawner/twigs/server/Application.kt b/api/src/main/kotlin/com/wbrawner/twigs/server/Application.kt new file mode 100644 index 0000000..1ee73ca --- /dev/null +++ b/api/src/main/kotlin/com/wbrawner/twigs/server/Application.kt @@ -0,0 +1,14 @@ +package com.wbrawner.twigs.server + +import io.ktor.application.* +import io.ktor.routing.* + +fun main(args: Array): Unit = io.ktor.server.cio.EngineMain.main(args) + +fun Application.module(testing: Boolean = false) { + routing { + get("/") { + call.respondText("Hello, world!") + } + } +} \ No newline at end of file diff --git a/api/src/main/resources/application.conf b/api/src/main/resources/application.conf new file mode 100644 index 0000000..908b401 --- /dev/null +++ b/api/src/main/resources/application.conf @@ -0,0 +1,8 @@ +ktor { + deployment { + port = 8080 + } + application { + modules = [ com.wbrawner.twigs.server.ApplicationKt.module ] + } +}