🏗️ Ktor Server lagt til

Co-authored-by: Amalie Erdal Mansaker <amalie.erdal.mansaker@nav.no>
Co-authored-by: Markus A. R. Johansen <markus.aleksander.rakil.johansen@nav.no>
This commit is contained in:
sindrekjelsrud 2023-07-03 15:00:27 +02:00
parent 941e2fe7ed
commit 1cb8e1713d
12 changed files with 195 additions and 114 deletions

View file

@ -1,3 +0,0 @@
fun main(args: Array<String>) {
println("Hello World!")
}

View file

@ -0,0 +1,15 @@
package no.nav.helse.sprik
import io.ktor.server.application.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
import no.nav.helse.sprik.plugins.*
fun main() {
embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module)
.start(wait = true)
}
fun Application.module() {
configureRouting()
}

View file

@ -0,0 +1,13 @@
package no.nav.helse.sprik.plugins
import io.ktor.server.routing.*
import io.ktor.server.response.*
import io.ktor.server.application.*
fun Application.configureRouting() {
routing {
get("/") {
call.respondText("Hello World!")
}
}
}

View 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>

View file

@ -0,0 +1,5 @@
package no.nav.helse.sprik
class ApplicationTest {
}