wai-middleware-static-embedded: Serve embedded static files as a Wai middleware

[ bsd3, library, web ] [ Propose Tags ]

Please see README.md


[Skip to Readme]

Modules

[Index]

Downloads

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

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Dependencies base (>=4.7 && <5), bytestring, cryptonite, http-types, memory, mime-types, text, wai, wai-extra [details]
License BSD-3-Clause
Copyright Copyright: (c) 2017 Adam Sandberg Eriksson
Author Adam Sandberg Eriksson
Maintainer adam@sandbergericsson.se
Revised Revision 1 made by adamse at 2017-04-30T16:57:16Z
Category Web
Home page https://github.com/adamse/wai-middleware-static-embedded#readme
Source repo head: git clone https://github.com/adamse/wai-middleware-static-embedded
Uploaded by adamse at 2017-04-27T21:12:43Z
Distributions NixOS:0.1.0.0
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 957 total (4 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-04-27 [all 1 reports]

Readme for wai-middleware-static-embedded-0.1.0.0

[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!")