wai-middleware-static-0.1.2: WAI middleware that intercepts requests to static files.

Safe HaskellSafe-Infered

Network.Wai.Middleware.Static

Synopsis

Documentation

static :: MiddlewareSource

Serve static files out of the application root (current directory). If file is found, it is streamed to the client and no further middleware is run.

staticRoot :: Text -> MiddlewareSource

Like static, but only looks for static files in the given directory. Supplied path may be relative or absolute and is prepended to the requested path.

 static = staticRoot ""

staticList :: [(Text, Text)] -> MiddlewareSource

Serve only the files given in an association list. Key is the URI, Value is the filesystem path.