Add ktor dependencies and basic server
This commit is contained in:
parent
00ffbbe303
commit
bcb58d47d7
3 changed files with 26 additions and 0 deletions
|
@ -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")
|
||||
|
|
14
api/src/main/kotlin/com/wbrawner/twigs/server/Application.kt
Normal file
14
api/src/main/kotlin/com/wbrawner/twigs/server/Application.kt
Normal 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!")
|
||||
}
|
||||
}
|
||||
}
|
8
api/src/main/resources/application.conf
Normal file
8
api/src/main/resources/application.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
ktor {
|
||||
deployment {
|
||||
port = 8080
|
||||
}
|
||||
application {
|
||||
modules = [ com.wbrawner.twigs.server.ApplicationKt.module ]
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue