diff options
| author | LLLL Colonq <llll@colonq> | 2025-10-23 21:54:06 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-10-23 21:54:06 -0400 |
| commit | 9cf01f48f9bf9cb882c2849198d0118fad4b4bf6 (patch) | |
| tree | 2c4fd626f391fdb792fcc80cf0b961e64b91cde3 /fig-web/src/Fig/Web/Utils.hs | |
| parent | 6bf32bdad1920aaef196a944cc4313dccbc2eacc (diff) | |
Add HLS streaming API
Diffstat (limited to 'fig-web/src/Fig/Web/Utils.hs')
| -rw-r--r-- | fig-web/src/Fig/Web/Utils.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fig-web/src/Fig/Web/Utils.hs b/fig-web/src/Fig/Web/Utils.hs index 521e781..72782d9 100644 --- a/fig-web/src/Fig/Web/Utils.hs +++ b/fig-web/src/Fig/Web/Utils.hs @@ -11,7 +11,7 @@ module Fig.Web.Utils , status , queryParam, queryParamMaybe, formParam, formParamMaybe, pathParam , header - , respondText, respondJSON, respondHTMLText, respondHTML, redirect + , respondBytes, respondText, respondJSON, respondHTMLText, respondHTML, redirect , WebsocketHandler , websocket , BusEventHandler, BusEventHandlers @@ -30,6 +30,7 @@ import qualified Data.UUID as UUID import qualified Data.UUID.V4 as UUID import qualified Data.Text as Text import qualified Data.Text.Lazy as Text.L +import qualified Data.ByteString.Lazy as BS.L import qualified Data.Aeson as Aeson import qualified Data.Map.Strict as Map @@ -144,6 +145,9 @@ header h = Sc.header (Text.L.fromStrict h) >>= \case Nothing -> pure Nothing Just t -> pure . Just $ Text.L.toStrict t +respondBytes :: ByteString -> Sc.ActionM () +respondBytes = Sc.raw . BS.L.fromStrict + respondText :: Text -> Sc.ActionM () respondText = Sc.text . Text.L.fromStrict |
