Add ktor dependencies and basic server

This commit is contained in:
William Brawner 2021-07-05 19:08:09 -06:00
parent 00ffbbe303
commit bcb58d47d7
3 changed files with 26 additions and 0 deletions

View file

@ -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")

View file

@ -0,0 +1,14 @@
package com.wbrawner.twigs.server
import io.ktor.application.*
import io.ktor.routing.*
fun main(args: Array<String>): Unit = io.ktor.server.cio.EngineMain.main(args)
fun Application.module(testing: Boolean = false) {
routing {
get("/") {
call.respondText("Hello, world!")
}
}
}

View file

@ -0,0 +1,8 @@
ktor {
deployment {
port = 8080
}
application {
modules = [ com.wbrawner.twigs.server.ApplicationKt.module ]
}
}