feat(server): use envvar for devmode constant
This commit is contained in:
parent
ef630b6d58
commit
ff2af310fb
2 changed files with 4 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ object Constants {
|
||||||
const val opendataKey: String = ""
|
const val opendataKey: String = ""
|
||||||
const val serverUrl: String = "https://banksia.lava.moe/api/"
|
const val serverUrl: String = "https://banksia.lava.moe/api/"
|
||||||
// TODO
|
// TODO
|
||||||
const val devMode: Boolean = false
|
var devMode: Boolean = false
|
||||||
const val updateKey: String = ""
|
const val updateKey: String = ""
|
||||||
const val protomapsKey: String = ""
|
const val protomapsKey: String = ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,14 @@ import org.koin.ktor.plugin.Koin
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
|
if (System.getenv("BANKSIA_PRODUCTION") == "1") Constants.devMode = false
|
||||||
|
|
||||||
embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module)
|
embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module)
|
||||||
.start(wait = true)
|
.start(wait = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Application.module() {
|
fun Application.module() {
|
||||||
|
log.info("devMode: ${Constants.devMode}")
|
||||||
install(ContentNegotiation) {
|
install(ContentNegotiation) {
|
||||||
json()
|
json()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue