File tree Expand file tree Collapse file tree
src/main/kotlin/com/sakethh/linkora Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ private fun connectToADatabase(serverConfig: ServerConfig): Database {
1616
1717fun configureDatabase () {
1818 val serverConfig = ServerConfiguration .readConfig()
19- lateinit var database: Database
19+ var database: Database ? = null
2020 try {
2121 database = connectToADatabase(serverConfig)
2222 transaction {
@@ -28,7 +28,7 @@ fun configureDatabase() {
2828 } catch (e: Exception ) {
2929
3030 if (e.message != " Unknown database 'linkora'" ) {
31- database.connector() .close()
31+ database? .connector?.invoke()? .close()
3232 }
3333
3434 if (e.message.toString().contains(" requires autoCommit to be enabled" )) {
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import com.sakethh.linkora.domain.repository.FoldersRepository
99import com.sakethh.linkora.domain.repository.LinksRepository
1010import com.sakethh.linkora.domain.repository.PanelsRepository
1111import com.sakethh.linkora.domain.repository.SyncRepo
12- import com.sakethh.linkora.domain.routes.SyncRoute
1312import com.sakethh.linkora.presentation.routing.http.foldersRouting
1413import com.sakethh.linkora.presentation.routing.http.linksRouting
1514import com.sakethh.linkora.presentation.routing.http.panelsRouting
@@ -22,12 +21,8 @@ import io.ktor.server.routing.*
2221
2322fun Application.configureRouting () {
2423 routing {
25- get(" /" ) {
26- call.respond(message = HttpStatusCode .OK , status = HttpStatusCode .OK )
27- }
28-
2924 authenticate(Security .BEARER .name) {
30- get(SyncRoute . TEST_BEARER .name ) {
25+ get(" / " ) {
3126 call.respond(message = HttpStatusCode .OK , status = HttpStatusCode .OK )
3227 }
3328 }
You can’t perform that action at this time.
0 commit comments