diff --git a/servant-server/src/Servant/Utils/StaticFiles.hs b/servant-server/src/Servant/Utils/StaticFiles.hs index ec1630e6..4db1ed6b 100644 --- a/servant-server/src/Servant/Utils/StaticFiles.hs +++ b/servant-server/src/Servant/Utils/StaticFiles.hs @@ -11,6 +11,8 @@ module Servant.Utils.StaticFiles , serveDirectoryFileServer , serveDirectoryEmbedded , serveDirectoryWith + , -- * Deprecated + serveDirectory ) where import Data.ByteString (ByteString) @@ -49,8 +51,6 @@ serveDirectoryWebApp :: FilePath -> Server Raw serveDirectoryWebApp = staticApp . defaultWebAppSettings . fixPath -- | Same as 'serveDirectoryWebApp', but uses `defaultFileServerSettings`. --- --- This used to be called 'serveDirectory' in @servant < 0.10@. serveDirectoryFileServer :: FilePath -> Server Raw serveDirectoryFileServer = staticApp . defaultFileServerSettings . fixPath @@ -70,6 +70,13 @@ serveDirectoryEmbedded files = staticApp (embeddedSettings files) serveDirectoryWith :: StaticSettings -> Server Raw serveDirectoryWith = staticApp +-- | Same as 'serveDirectoryFileServer'. It used to be the only +-- file serving function in servant pre-0.10 and will be kept +-- around for a few versions, but is deprecated. +serveDirectory :: FilePath -> Server Raw +serveDirectory = serveDirectoryFileServer +{-# DEPRECATED serveDirectory "Use serveDirectoryFileServer instead" #-} + fixPath :: FilePath -> FilePath fixPath = #if MIN_VERSION_wai_app_static(3,1,0)