Skip to content

Commit

Permalink
Merge pull request #10 from caffeine-moe/dev
Browse files Browse the repository at this point in the history
balls
  • Loading branch information
caffeine01 authored May 28, 2022
2 parents 23beb98 + c226988 commit 63e3598
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/main/kotlin/org/caffeine/chaos/ui/WebUI.kt
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
package org.caffeine.chaos.ui

import io.ktor.server.application.*
import io.ktor.server.cio.*
import io.ktor.server.engine.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
import kotlinx.coroutines.coroutineScope
import org.caffeine.chaos.api.client.Client

class WebUI {
suspend fun init(client: Client) = coroutineScope {
if (!client.config.web_ui.enabled) { return@coroutineScope }
serv()
}
private suspend fun serv() = coroutineScope {
embeddedServer(CIO, port = 7270) {
routing {
get("/") {
call.respondText("Hello, world!")
}
}
}.start(wait = true)
}
}

0 comments on commit 63e3598

Please sign in to comment.