diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-10-13 11:55:20 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-10-13 11:55:20 +0200 |
commit | e66534eefb5979c1ec5e0a28e9c29969ae2c9884 (patch) | |
tree | 3b919222ab147741cb9332537997e590b104eb01 /backend/lib/ACMS/API/REST.hs | |
parent | 997442c6b99bef99c429d4ab7f676fdf9ae09096 (diff) |
improve REST API
Diffstat (limited to 'backend/lib/ACMS/API/REST.hs')
-rw-r--r-- | backend/lib/ACMS/API/REST.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/backend/lib/ACMS/API/REST.hs b/backend/lib/ACMS/API/REST.hs index 64b47b7..ec72db9 100644 --- a/backend/lib/ACMS/API/REST.hs +++ b/backend/lib/ACMS/API/REST.hs @@ -13,19 +13,15 @@ import Miso.String qualified as J #endif import Control.Monad.Catch (MonadThrow) import Data.Aeson qualified as A -import Data.ByteString.Char8 qualified as B import Data.ByteString.Lazy.Char8 qualified as LB import Data.Function ((&)) +import Data.String (IsString (fromString)) import Miso (JSM) import Miso.String (MisoString) restRequest :: String -> Request restRequest endpoint = - defaultRequest - & setRequestSecure False - & setRequestHost "localhost" - & setRequestPort 8081 - & setRequestPath ("/api/rest" <> B.pack endpoint) + fromString ("http://localhost:8081/api/rest/" <> endpoint) schemaVersion :: (APIMonad m, A.FromJSON a) => m a schemaVersion = |