loli: A minimum web dev DSL in Haskell

[ bsd3, deprecated, library, web ] [ Propose Tags ]
Deprecated in favor of miku

A simple and easy to use library for fast web prototyping in Haskell.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 2009.6.25, 2009.6.26, 2009.6.27, 2009.6.29, 2009.7.2, 2009.8.16, 2009.8.18, 2009.10.13, 2010.10.9, 2011.6.24
Change log changelog.md
Dependencies base (>4 && <=5), data-default, hack (>=2009.5.19), hack-contrib (>=2009.6.25), mps (>=2009.6.25), mtl, utf8-string [details]
License BSD-3-Clause
Author Wang, Jinjing
Maintainer Wang, Jinjing <nfjinjing@gmail.com>
Category Web
Home page http://github.com/nfjinjing/loli
Uploaded by JinjingWang at 2009-06-25T17:15:23Z
Distributions
Reverse Dependencies 2 direct, 3 indirect [details]
Downloads 7003 total (23 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for loli-2009.6.26

[back to package description]

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"