separate Global API

This commit is contained in:
Aria Moradi
2021-08-05 05:40:48 +04:30
parent 67ec9ccc4e
commit 704a52d943
6 changed files with 31 additions and 10 deletions

View File

@@ -0,0 +1,25 @@
package suwayomi.tachidesk.global
import io.javalin.Javalin
import suwayomi.tachidesk.global.impl.About
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
object GlobalAPI {
fun defineEndpoints(app: Javalin) {
// returns some static info about the current app build
app.get("/api/v1/settings/about/") { ctx ->
ctx.json(About.getAbout())
}
// TODO: app update check api
app.get("/api/v1/settings/check-update/") { ctx ->
ctx.json(About.getAbout())
}
}
}