on master help sign in
Doc tweaks
commit10f0201936c15f2186718e3f5ead1196b0a12bf5 authorMichael Snoyman <michael@snoyman.com> dateTue 22 May 2012, 07:28 (14 years ago) parent15a9947
5 files changed+8−5
wai-app-static/Network/Wai/Application/Static.hs+1 wai-app-static/WaiAppStatic/Listing.hs+3−1 wai-app-static/WaiAppStatic/Mime.hs+1−1 wai-app-static/WaiAppStatic/Storage/Filesystem.hs−3 wai-app-static/WaiAppStatic/Types.hs+3
wai-app-static/Network/Wai/Application/Static.hs+1
@@ -204,6 +204,7 @@ serveFile StaticSettings {..} pieces req file =
204204 MaxAgeSeconds _ -> id -- FIXME
205205 MaxAgeForever -> (:) ("Expires", "Thu, 31 Dec 2037 23:55:55 GMT")
206206
207+-- | Turn a @StaticSettings@ into a WAI application.
207208staticApp :: StaticSettings -> W.Application
208209staticApp set req = staticAppPieces set (W.pathInfo req) req
209210
wai-app-static/WaiAppStatic/Listing.hs+3−1
@@ -17,7 +17,9 @@ import Util
1717
1818import qualified Text.Blaze.Html.Renderer.Utf8 as HU
1919
20−-- Code below taken from Happstack: http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happstack-server/src/Happstack/Server/FileServe/BuildingBlocks.hs
20+-- | Provides a default directory listing, suitable for most apps.
21+--
22+-- Code below taken from Happstack: <http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happstack-server/src/Happstack/Server/FileServe/BuildingBlocks.hs>
2123defaultListing :: Listing
2224defaultListing pieces (Folder contents) = do
2325 let isTop = null pieces || map Just pieces == [toPiece ""]
wai-app-static/WaiAppStatic/Mime.hs+1−1
@@ -96,6 +96,6 @@ mimeByExt mm def =
9696 Nothing -> go es
9797 Just mt -> mt
9898
99−-- | @mimeTypeByExt@ applied to @defaultMimeType@ and @defaultMimeMap@.
99+-- | @mimeByExt@ applied to @defaultMimeType@ and @defaultMimeMap@.
100100defaultMimeLookup :: Piece -> MimeType
101101defaultMimeLookup = mimeByExt defaultMimeMap defaultMimeType
wai-app-static/WaiAppStatic/Storage/Filesystem.hs−3
@@ -8,9 +8,6 @@ module WaiAppStatic.Storage.Filesystem
88 , defaultWebAppSettings
99 , defaultFileServerSettings
1010 , webAppSettingsWithLookup
11− -- * Misc for testing
12− , hashFile
13− , fileSystemLookup
1411 ) where
1512
1613import WaiAppStatic.Types
wai-app-static/WaiAppStatic/Types.hs+3
@@ -131,6 +131,9 @@ type Extension = Text
131131type MimeMap = Map.Map Extension MimeType
132132
133133-- | All of the settings available to users for tweaking wai-app-static.
134+--
135+-- Note that you should use the settings type approach for modifying values.
136+-- See <http://www.yesodweb.com/book/settings-types> for more information.
134137data StaticSettings = StaticSettings
135138 {
136139 -- | Lookup a single file or folder. This is how you can control storage