mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-28 13:53:28 +02:00
welcome to onyx
This commit is contained in:
27
backend/onyx/server/manage/get_state.py
Normal file
27
backend/onyx/server/manage/get_state.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from onyx import __version__
|
||||
from onyx.auth.users import user_needs_to_be_verified
|
||||
from onyx.configs.app_configs import AUTH_TYPE
|
||||
from onyx.server.manage.models import AuthTypeResponse
|
||||
from onyx.server.manage.models import VersionResponse
|
||||
from onyx.server.models import StatusResponse
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/health")
|
||||
def healthcheck() -> StatusResponse:
|
||||
return StatusResponse(success=True, message="ok")
|
||||
|
||||
|
||||
@router.get("/auth/type")
|
||||
def get_auth_type() -> AuthTypeResponse:
|
||||
return AuthTypeResponse(
|
||||
auth_type=AUTH_TYPE, requires_verification=user_needs_to_be_verified()
|
||||
)
|
||||
|
||||
|
||||
@router.get("/version")
|
||||
def get_version() -> VersionResponse:
|
||||
return VersionResponse(backend_version=__version__)
|
Reference in New Issue
Block a user