@hackage loli2009.6.26
A minimum web dev DSL in Haskell
Categories
License
BSD-3-Clause
Maintainer
Wang, Jinjing <nfjinjing@gmail.com>
Links
- Homepage
- Documentation
- No source repository
- Changelog
- Security
Versions
Deprecated
Dependencies (7)
- base >4 && <=5
- data-default
- hack >=2009.5.19
- hack-contrib >=2009.6.25
- mps >=2009.6.25
- mtl Show all…
Dependents (4)
@hackage/hledger, @hackage/acme-everything, @hackage/source-code-server, @hackage/maid
Example
import Network.Loli
import Hack.Handler.Happstack
main = run . loli $ do
-- simple
get "/hello" (text "hello world")
-- io
get "/cabal" $ text =<< io (readFile "loli.cabal")
-- route captures
get "/say/:user/:verb" $ do
text . show =<< captured
-- html output
get "/html" (html "<html><body><p>loli power!</p></body></html>")
-- default
get "/" (text "at root")
-- public serve, only allows /src
public (Just ".") ["/src"]
-- treat .hs extension as text/plain
mime "hs" "text/plain"