After many months of hard work, the Snap team is proud to announce the release of the next major version of the Snap Framework: Snap 0.3.
- Snap now has SSL support! To enable SSL support, install the gnutls library and pass the “
gnutls” flag when you build
$ cabal install snap-server -fgnutls
snapproject starter executable has been pulled out of
snap-coreand put into its own package, called “snap”. The
snappackage also contains some library code which the generated projects make use of, and the generated projects have a simplified and much cleaner layout.
Snap now comes with support for working in a “development mode” which runs your web handlers in an interpreter using the hint library. This makes working on Snap applications quicker and more convenient, since you no longer need to perform a kill/recompile/reload cycle to see your code changes reflected in your running application.
One of the new things in the
snappackage is an experimental “extensions” mechanism which contains some interfaces/helper code for writing reusable web components.
MonadSnaptypeclass has been defined:
class (Monad m, MonadIO m, MonadCatchIO m, MonadPlus m, Functor m, Applicative m, Alternative m) => MonadSnap m where liftSnap :: Snap a -> m a
Most of the basic functions from
Snap.Typeshave been redefined to accept any monad implementing
MonadSnapinstances have been defined for most of the standard monad transformers; this should make it much more convenient to use monad transformers with Snap without having to use “
lift” all over the place.
getCookie :: MonadSnap m => ByteString -> m (Maybe Cookie), which allows you to fetch cookies from the request by name.
Snap now depends on the
enumeratorpackage for iteratee support instead of
snap-servernow has a convenient configuration mechanism which will parse arguments from the command line for you.
Changed type signature of
Response -> Snap ()to
Response -> Snap a.
fileServe, file paths are now properly URL-decoded, meaning you can now download a file with spaces in its name.
Parameters grabbed by variable capture using
routeare also now URL-decoded.
Under the hood: snap server backend mechanism has been improved/factored out, making it possible to listen to two or more ports using different backends at once (e.g. SSL and non-SSL).