🏗️ 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:
parent
941e2fe7ed
commit
1cb8e1713d
12 changed files with 195 additions and 114 deletions
|
@ -1,3 +0,0 @@
|
|||
fun main(args: Array<String>) {
|
||||
println("Hello World!")
|
||||
}
|
15
backend/src/main/kotlin/no/nav/helse/sprik/Application.kt
Normal file
15
backend/src/main/kotlin/no/nav/helse/sprik/Application.kt
Normal 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()
|
||||
}
|
|
@ -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!")
|
||||
}
|
||||
}
|
||||
}
|
12
backend/src/main/resources/logback.xml
Normal file
12
backend/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>
|
|
@ -0,0 +1,5 @@
|
|||
package no.nav.helse.sprik
|
||||
|
||||
|
||||
class ApplicationTest {
|
||||
}
|
Reference in a new issue