playground running

This commit is contained in:
Ryan
2021-04-11 09:52:26 -04:00
parent 070c084f61
commit 98d29f2d53
5 changed files with 73 additions and 1 deletions

View File

@ -5,6 +5,18 @@ plugins {
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation(projects.lib)
implementation(libs.bundles.ktor)
implementation(libs.bundles.logging)
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
application {
@Suppress("DEPRECATION")
mainClassName = "org.leafygreens.kompendium.playground.MainKt"
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=true") // TODO I don't think this is working 😢
}

View File

@ -0,0 +1,28 @@
package org.leafygreens.kompendium.playground
import io.ktor.application.Application
import io.ktor.application.call
import io.ktor.response.respondText
import io.ktor.routing.get
import io.ktor.routing.route
import io.ktor.routing.routing
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
fun main() {
embeddedServer(
Netty,
port = 8080,
module = Application::mainModule
).start(wait = true)
}
fun Application.mainModule() {
routing {
route("/") {
get {
call.respondText("hi")
}
}
}
}

View File

@ -0,0 +1,14 @@
<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>