Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.
/ wai-static-th Public archive

Simple Template Haskell helper to manage your WAI application static assets.

License

Notifications You must be signed in to change notification settings

aveltras/wai-static-th

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wai-static-th

Simple Template Haskell helper to manage your WAI application static assets.

Usage

Call mkStaticApp passing the path to your assets directory relative to cabal file location.

This will generate a function staticApp which takes a Bool indicating whether your files should be reloaded when they change. This should be True in development and False in production.

Functions returning the hashed names are also generated (see example below).

The following is an example using this library's source files.

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

import           Network.Wai.Handler.Warp (run)
import           Network.Wai.Static.TH

mkStaticApp "src"

main :: IO ()
main = do
  print $ network_wai_static_th_hs -- Network/Wai/Static/TH-b852dc8617e5f58f8b9c0724ba2e8455.hs
  let reloadOnChange = False
  run 3000 $ staticApp reloadOnChange

About

Simple Template Haskell helper to manage your WAI application static assets.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published