Try to add database container
continuous-integration/drone/push Build is failing Details

pull/3/head^2
Lucas EVARD 1 year ago
parent f7a4890983
commit 9e8b42d862

@ -14,6 +14,13 @@ import io.ktor.server.config.*
import io.ktor.server.engine.* import io.ktor.server.engine.*
import io.ktor.server.netty.* import io.ktor.server.netty.*
import io.ktor.server.plugins.contentnegotiation.* import io.ktor.server.plugins.contentnegotiation.*
import org.ktorm.database.Database
val db_database=System.getenv().get("POSTGRES_DB")
val db_user=System.getenv().get("POSTGRES_USER")
val db_password=System.getenv().get("POSTGRES_PASSWORD")
val database = Database.connect("jdbc:postgresql:$db_database", user = db_user, password = db_password)
fun main() { fun main() {
embeddedServer(Netty, port = 8080, host = "0.0.0.0") { embeddedServer(Netty, port = 8080, host = "0.0.0.0") {
@ -24,6 +31,7 @@ fun main() {
private fun Application.extracted() { private fun Application.extracted() {
val config = HoconApplicationConfig(ConfigFactory.load()) val config = HoconApplicationConfig(ConfigFactory.load())
val tokenManager = TokenManager.getInstance(config) val tokenManager = TokenManager.getInstance(config)
println("jdbc:postgresql:$db_database$db_user$db_password")
authentication { authentication {
jwt { jwt {
verifier(tokenManager.verifyJWTToken()) verifier(tokenManager.verifyJWTToken())

@ -24,8 +24,6 @@ val RegexCheckerUser = AppConfig.regexChecker
val CryptManagerUser = AppConfig.cryptManager val CryptManagerUser = AppConfig.cryptManager
val tokenManagerUser = AppConfig.tokenManager val tokenManagerUser = AppConfig.tokenManager
const val DEFAULT_COINS = 500 const val DEFAULT_COINS = 500
val database = Database.connect("jdbc:postgresql://localhost:5432/Allin", user = "postgres", password = "lulu")
fun Application.UserRouter() { fun Application.UserRouter() {
routing { routing {

Loading…
Cancel
Save