The wai-middleware-static-embedded package

[ Tags: bsd3, library, web ] [ Propose Tags ]

Please see

[Skip to Readme]


Dependencies base (>=4.7 && <5), bytestring, cryptonite, http-types, memory, mime-types, text, wai, wai-extra [details]
License BSD3
Copyright Copyright: (c) 2017 Adam Sandberg Eriksson
Author Adam Sandberg Eriksson
Category Web
Home page
Source repo head: git clone
Uploaded Thu Apr 27 21:12:43 UTC 2017 by adamse
Updated Sun Apr 30 16:57:16 UTC 2017 by adamse to revision 1   [What is this?]
Distributions NixOS:
Downloads 321 total (11 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-04-27 [all 1 reports]
Hackage Matrix CI




Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees

Readme for wai-middleware-static-embedded-

[back to package description]

Static embedded middleware

A middleware to serve static files from memory. Works particularly well with file-embed.

Example usage

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}

import Network.Wai.Middleware.StaticEmbedded -- This package
import Data.FileEmbed -- file-embed
import Web.Scotty -- scotty

main :: IO ()
main = scotty 1337 $ do
  middleware (static $(embedDir ".")) -- serves the source directory
  notFound (text "404: Not found!")