aboutsummaryrefslogtreecommitdiffstats
path: root/backend/lib/ACMS/API/REST.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-10-13 11:55:20 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-10-13 11:55:20 +0200
commite66534eefb5979c1ec5e0a28e9c29969ae2c9884 (patch)
tree3b919222ab147741cb9332537997e590b104eb01 /backend/lib/ACMS/API/REST.hs
parent997442c6b99bef99c429d4ab7f676fdf9ae09096 (diff)
improve REST API
Diffstat (limited to 'backend/lib/ACMS/API/REST.hs')
-rw-r--r--backend/lib/ACMS/API/REST.hs8
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 =