feat(server): use envvar for devmode constant

This commit is contained in:
Cilly Leang 2026-04-30 17:26:41 +10:00
parent ef630b6d58
commit ff2af310fb
Signed by: cilly
GPG key ID: 6500251E087653C9
2 changed files with 4 additions and 1 deletions

View file

@ -6,7 +6,7 @@ object Constants {
const val opendataKey: String = ""
const val serverUrl: String = "https://banksia.lava.moe/api/"
// TODO
const val devMode: Boolean = false
var devMode: Boolean = false
const val updateKey: String = ""
const val protomapsKey: String = ""
}

View file

@ -33,11 +33,14 @@ import org.koin.ktor.plugin.Koin
import kotlin.time.Clock
fun main() {
if (System.getenv("BANKSIA_PRODUCTION") == "1") Constants.devMode = false
embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module)
.start(wait = true)
}
fun Application.module() {
log.info("devMode: ${Constants.devMode}")
install(ContentNegotiation) {
json()
}