diff options
| author | adambrangenberg <adabran06@gmail.com> | 2025-12-24 03:40:10 +0100 |
|---|---|---|
| committer | adambrangenberg <adabran06@gmail.com> | 2025-12-24 03:40:10 +0100 |
| commit | a0886694f73fc382d78da79ab8bfb27475757bab (patch) | |
| tree | 652ba9b603a1acaf4dfca188f7bb2c29c6bccfd0 /src/Endpoints/VersionsEndpoint.hs | |
| parent | 2b48a574e8b9fed03a5c1969af4bb1e338f1be26 (diff) | |
Implemented basic auth, refactor
Diffstat (limited to 'src/Endpoints/VersionsEndpoint.hs')
| -rw-r--r-- | src/Endpoints/VersionsEndpoint.hs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Endpoints/VersionsEndpoint.hs b/src/Endpoints/VersionsEndpoint.hs index 79fd3ea..e5739cf 100644 --- a/src/Endpoints/VersionsEndpoint.hs +++ b/src/Endpoints/VersionsEndpoint.hs @@ -1,12 +1,22 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} -module Endpoints.VersionsEndpoint (VersionsAPI, handleVersions) where +module Endpoints.VersionsEndpoint (VersionsAPI, versionsServer) where import Servant -import Data.VersionsData +import Data.Text (pack) -type VersionsAPI = "_matrix" :> "client" :> "versions" :> Get '[JSON] Versions +import Model.Versions -handleVersions :: Handler Versions -handleVersions = return (makeVersions ["1.12"]) +---------------------------------------------------------------------------------------------------- +type VersionsAPI = GetVersions + +versionsServer :: Server VersionsAPI +versionsServer = handleVersionsGet +-- http://localhost:8080 +--- GET /_matrix/client/versions ------------------------------------------------------------------- +type GetVersions = "_matrix" :> "client" :> "versions" + :> Get '[JSON] VersionsResponse + +handleVersionsGet :: Handler VersionsResponse +handleVersionsGet = return $ VersionsResponse [pack "v1.12"] |