Skip to content

Commit 0a3b227

Browse files
alpmestanphadej
authored andcommitted
fix static file serving test
1 parent 8efabed commit 0a3b227

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

servant-server/src/Servant/Utils/StaticFiles.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ serveDirectoryWebApp :: FilePath -> Server Raw
4949
serveDirectoryWebApp = staticApp . defaultWebAppSettings . fixPath
5050

5151
-- | Same as 'serveDirectoryWebApp', but uses `defaultFileServerSettings`.
52+
--
53+
-- This used to be called 'serveDirectory' in @servant < 0.10@.
5254
serveDirectoryFileServer :: FilePath -> Server Raw
5355
serveDirectoryFileServer = staticApp . defaultFileServerSettings . fixPath
5456

servant-server/test/Servant/Utils/StaticFilesSpec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Test.Hspec.Wai (get, shouldRespondWith, with)
1818
import Servant.API ((:<|>) ((:<|>)), Capture, Get, Raw, (:>), JSON)
1919
import Servant.Server (Server, serve)
2020
import Servant.ServerSpec (Person (Person))
21-
import Servant.Utils.StaticFiles (serveDirectory)
21+
import Servant.Utils.StaticFiles (serveDirectoryFileServer)
2222

2323
type Api =
2424
"dummy_api" :> Capture "person_name" String :> Get '[JSON] Person
@@ -34,7 +34,7 @@ app = serve api server
3434
server :: Server Api
3535
server =
3636
(\ name_ -> return (Person name_ 42))
37-
:<|> serveDirectory "static"
37+
:<|> serveDirectoryFileServer "static"
3838

3939
withStaticFiles :: IO () -> IO ()
4040
withStaticFiles action = withSystemTempDirectory "servant-test" $ \ tmpDir ->

0 commit comments

Comments
 (0)