Add version api endpoint (#66)
This commit is contained in:
committed by
GitHub
parent
1ea821584c
commit
34d8feacdd
@@ -0,0 +1,6 @@
|
||||
package ir.armor.tachidesk.impl
|
||||
import ir.armor.tachidesk.BuildConfig
|
||||
|
||||
fun getVersion(): String {
|
||||
return BuildConfig.VERSION
|
||||
}
|
||||
@@ -33,6 +33,7 @@ import ir.armor.tachidesk.impl.Source.getSourceList
|
||||
import ir.armor.tachidesk.impl.backup.BackupFlags
|
||||
import ir.armor.tachidesk.impl.backup.legacy.LegacyBackupExport.createLegacyBackup
|
||||
import ir.armor.tachidesk.impl.backup.legacy.LegacyBackupImport.restoreLegacyBackup
|
||||
import ir.armor.tachidesk.impl.getVersion
|
||||
import ir.armor.tachidesk.server.util.openInBrowser
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -297,6 +298,11 @@ object JavalinSetup {
|
||||
ctx.status(200)
|
||||
}
|
||||
|
||||
// returns version of the app
|
||||
app.get("/api/v1/version/") { ctx ->
|
||||
ctx.json(getVersion())
|
||||
}
|
||||
|
||||
// category modification
|
||||
app.patch("/api/v1/category/:categoryId") { ctx ->
|
||||
val categoryId = ctx.pathParam("categoryId").toInt()
|
||||
|
||||
Reference in New Issue
Block a user