Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Create a XStaticFile
served as /my-file.txt or /xstatic/my-file.txt:
myFile :: XStaticFile myFile = $(embedXStaticFile "./data/my-file.txt")
Synopsis
- embedXStaticFile :: FilePath -> Q Exp
- embedXStaticFileVersion :: FilePath -> Version -> Q Exp
- data XStaticFile
Documentation
embedXStaticFile :: FilePath -> Q Exp Source #
Embed a static file in its compressed form.
The following rules are applied to convert a local filepath to the expected request path:
- ., / and "data/" prefix are removed
- ".gz" and "index.html" suffix are removed
embedXStaticFileVersion :: FilePath -> Version -> Q Exp Source #
Same as embedXStaticFile
, but using the provided Version
for the xfETag
value.
re-export from XStatic
data XStaticFile #
A static file definition.
Use the xstatic-th
or file-embed
library to embed a local file.