Safe Haskell | None |
---|---|
Language | Haskell2010 |
- serveAssets :: Options -> IO Application
- data Options = Options {}
- class Default a where
- def :: a
Documentation
serveAssets :: Options -> IO Application Source #
serveAssets
will create a wai Application
that serves files from the
"assets" directory.
The workflow that serveAssets
allows is similar to working on files (for
web-sites) that don't need compilation or generation, e.g. html, css, php or
javascript. You edit the file in an editor, save it, switch to a browser and
hit reload. serveAssets
makes sure your browser will be sent up-to-date
files.
To accomplish this, serveAssets
assumes that there's a Makefile in the
directory pointed to by clientDir
(default: "client"). This Makefile is
supposed to put compilation results into the "assets" directory. On every
request, serveAssets
will execute that Makefile and only start serving
files once the Makefile is done. (serveAssets
makes sure not to run your
Makefile concurrently.)
re-exports
A class for types with a default value.
Nothing