{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE TemplateHaskell #-}
{-# Language QuasiQuotes #-}
module Yesod.Static.Streamly (
staticStreamly,
staticFilesStreamly
) where
import Yesod.Static.Streamly.Internal
import Language.Haskell.TH
import Network.Wai.Application.Static (webAppSettingsWithLookup)
import Yesod.Static
staticStreamly :: FilePath
-> IO Static
staticStreamly :: FilePath -> IO Static
staticStreamly FilePath
dir = do
ETagLookup
hashLookup <- FilePath -> IO ETagLookup
cachedETagLookupStreamly FilePath
dir
Static -> IO Static
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Static -> IO Static) -> Static -> IO Static
forall a b. (a -> b) -> a -> b
$ StaticSettings -> Static
Static (StaticSettings -> Static) -> StaticSettings -> Static
forall a b. (a -> b) -> a -> b
$ FilePath -> ETagLookup -> StaticSettings
webAppSettingsWithLookup FilePath
dir ETagLookup
hashLookup
staticFilesStreamly :: FilePath
-> Q [Dec]
staticFilesStreamly :: FilePath -> Q [Dec]
staticFilesStreamly FilePath
dir = FilePath -> Q [Dec]
mkStaticFilesStreamly FilePath
dir