mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Add (inofficial) routes to get system information
This commit is contained in:
@ -104,7 +104,8 @@ object RestServer {
|
||||
def adminRoutes[F[_]: Effect](cfg: Config, restApp: RestApp[F]): HttpRoutes[F] =
|
||||
Router(
|
||||
"fts" -> FullTextIndexRoutes.admin(cfg, restApp.backend),
|
||||
"user" -> UserRoutes.admin(restApp.backend)
|
||||
"user" -> UserRoutes.admin(restApp.backend),
|
||||
"info" -> InfoRoutes.admin(cfg)
|
||||
)
|
||||
|
||||
def redirectTo[F[_]: Effect](path: String): HttpRoutes[F] = {
|
||||
|
@ -1,9 +1,11 @@
|
||||
package docspell.restserver.routes
|
||||
|
||||
import cats.effect.Sync
|
||||
import cats.implicits._
|
||||
|
||||
import docspell.common._
|
||||
import docspell.restapi.model.VersionInfo
|
||||
import docspell.restserver.BuildInfo
|
||||
import docspell.restserver.{BuildInfo, Config}
|
||||
|
||||
import org.http4s.HttpRoutes
|
||||
import org.http4s.circe.CirceEntityEncoder._
|
||||
@ -26,4 +28,13 @@ object InfoRoutes {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
def admin[F[_]: Sync](cfg: Config): HttpRoutes[F] = {
|
||||
val dsl = new Http4sDsl[F] {}
|
||||
import dsl._
|
||||
HttpRoutes.of[F] { case GET -> Root / "system" =>
|
||||
JvmInfo.create[F](cfg.appId).flatMap(Ok(_))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user