The wai-middleware-static-embedded package

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

Please see README.md


[Skip to Readme]

Properties

Versions 0.1.0.0
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
Maintainer adam@sandbergericsson.se
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 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:0.1.0.0
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

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

For package maintainers and hackage trustees


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