Skip to content

Commit

Permalink
Enable index.html for static files
Browse files Browse the repository at this point in the history
  • Loading branch information
koterpillar committed Mar 29, 2017
1 parent f89e8bf commit 19d0b38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ site = do
address <- lift $ asks appAddress
appDir <- lift $ asks appDirectory
let routedSite = boomerangSiteRouteT handler sitemap
let staticSite = serveDirectory DisableBrowsing [] $ appDir ++ "/static"
let staticSite = serveDirectory DisableBrowsing ["index.html"] $ appDir ++ "/static"
implSite address "" routedSite `mplus` staticSite

-- Run an action in application routing context
Expand Down
4 changes: 4 additions & 0 deletions testsuite/Integration/TestStatic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ import Test.Framework
test_static = do
resp <- makeRequest $ simpleRequest "/some-verification-file.html"
assertEqual "This is the exact content of the verification file.\n" resp

test_static_index = do
resp <- makeRequest $ simpleRequest "/with_index/"
assertEqual "Index file\n" resp
1 change: 1 addition & 0 deletions testsuite/Integration/content/static/with_index/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Index file

0 comments on commit 19d0b38

Please sign in to comment.