Add minimal Ktor server
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package de.ruvnox.tactical
|
||||
|
||||
import io.ktor.http.ContentType
|
||||
import io.ktor.server.application.Application
|
||||
import io.ktor.server.engine.embeddedServer
|
||||
import io.ktor.server.netty.Netty
|
||||
import io.ktor.server.response.respondText
|
||||
import io.ktor.server.routing.get
|
||||
import io.ktor.server.routing.routing
|
||||
|
||||
fun main() {
|
||||
embeddedServer(
|
||||
Netty,
|
||||
port = 8080,
|
||||
host = "0.0.0.0",
|
||||
module = Application::module
|
||||
).start(wait = true)
|
||||
}
|
||||
|
||||
fun Application.module() {
|
||||
routing {
|
||||
get("/health") {
|
||||
call.respondText(
|
||||
text = "RUVNOX Tactical server online",
|
||||
contentType = ContentType.Text.Plain
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user