File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
servant-server/src/Servant/Utils Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ module Servant.Utils.StaticFiles
11
11
, serveDirectoryFileServer
12
12
, serveDirectoryEmbedded
13
13
, serveDirectoryWith
14
+ , -- * Deprecated
15
+ serveDirectory
14
16
) where
15
17
16
18
import Data.ByteString (ByteString )
@@ -49,8 +51,6 @@ serveDirectoryWebApp :: FilePath -> Server Raw
49
51
serveDirectoryWebApp = staticApp . defaultWebAppSettings . fixPath
50
52
51
53
-- | Same as 'serveDirectoryWebApp', but uses `defaultFileServerSettings`.
52
- --
53
- -- This used to be called 'serveDirectory' in @servant < 0.10@.
54
54
serveDirectoryFileServer :: FilePath -> Server Raw
55
55
serveDirectoryFileServer = staticApp . defaultFileServerSettings . fixPath
56
56
@@ -70,6 +70,13 @@ serveDirectoryEmbedded files = staticApp (embeddedSettings files)
70
70
serveDirectoryWith :: StaticSettings -> Server Raw
71
71
serveDirectoryWith = staticApp
72
72
73
+ -- | Same as 'serveDirectoryFileServer'. It used to be the only
74
+ -- file serving function in servant pre-0.10 and will be kept
75
+ -- around for a few versions, but is deprecated.
76
+ serveDirectory :: FilePath -> Server Raw
77
+ serveDirectory = serveDirectoryFileServer
78
+ {-# DEPRECATED serveDirectory "Use serveDirectoryFileServer instead" #-}
79
+
73
80
fixPath :: FilePath -> FilePath
74
81
fixPath =
75
82
#if MIN_VERSION_wai_app_static(3,1,0)
You can’t perform that action at this time.
0 commit comments