This commit is contained in:
@@ -23,6 +23,7 @@ import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.jetbrains.exposed.sql.SchemaUtils
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import org.koin.ktor.ext.Koin
|
||||
|
||||
fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)
|
||||
|
||||
@@ -33,13 +34,16 @@ fun Application.module() {
|
||||
gson {
|
||||
}
|
||||
}
|
||||
install(Koin) {
|
||||
printLogger()
|
||||
modules(com.kmalbz.di.injectionModule)
|
||||
}
|
||||
|
||||
DatabaseFactory.init()
|
||||
transaction{
|
||||
SchemaUtils.create(ResultObjects)
|
||||
}
|
||||
|
||||
|
||||
val appConfig = HoconApplicationConfig(ConfigFactory.load())
|
||||
val factory = ConnectionFactory()
|
||||
factory.host = appConfig.property("ktor.mq.host").getString()
|
||||
@@ -72,14 +76,6 @@ fun Application.module() {
|
||||
|
||||
routing {
|
||||
install(StatusPages) {
|
||||
exception<AuthenticationException> {
|
||||
call.respond(HttpStatusCode.Unauthorized)
|
||||
}
|
||||
|
||||
exception<AuthorizationException> {
|
||||
call.respond(HttpStatusCode.Forbidden)
|
||||
}
|
||||
|
||||
exception<HttpException> {
|
||||
call.respond(HttpStatusCode.BadRequest)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user