init
This commit is contained in:
commit
aebc802b88
54 changed files with 1598 additions and 0 deletions
21
server/build.gradle.kts
Normal file
21
server/build.gradle.kts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
plugins {
|
||||
alias(libs.plugins.kotlinJvm)
|
||||
alias(libs.plugins.ktor)
|
||||
application
|
||||
}
|
||||
|
||||
group = "moe.lava.banksia"
|
||||
version = "1.0.0"
|
||||
application {
|
||||
mainClass.set("moe.lava.banksia.ApplicationKt")
|
||||
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=${extra["io.ktor.development"] ?: "false"}")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.shared)
|
||||
implementation(libs.logback)
|
||||
implementation(libs.ktor.server.core)
|
||||
implementation(libs.ktor.server.netty)
|
||||
testImplementation(libs.ktor.server.tests)
|
||||
testImplementation(libs.kotlin.test.junit)
|
||||
}
|
||||
20
server/src/main/kotlin/moe/lava/banksia/Application.kt
Normal file
20
server/src/main/kotlin/moe/lava/banksia/Application.kt
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package moe.lava.banksia
|
||||
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.engine.*
|
||||
import io.ktor.server.netty.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
|
||||
fun main() {
|
||||
embeddedServer(Netty, port = SERVER_PORT, host = "0.0.0.0", module = Application::module)
|
||||
.start(wait = true)
|
||||
}
|
||||
|
||||
fun Application.module() {
|
||||
routing {
|
||||
get("/") {
|
||||
call.respondText("Ktor: ${Greeting().greet()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
12
server/src/main/resources/logback.xml
Normal file
12
server/src/main/resources/logback.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<root level="trace">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
<logger name="org.eclipse.jetty" level="INFO"/>
|
||||
<logger name="io.netty" level="INFO"/>
|
||||
</configuration>
|
||||
Loading…
Add table
Add a link
Reference in a new issue