The hack package

[Tags: bsd3, deprecated, library]

Deprecated in favor of hack2

a sexy Haskell Webserver Interface


[Skip to ReadMe]

Properties

Versions2009.4.20, 2009.4.21, 2009.4.22, 2009.4.23, 2009.4.25, 2009.4.26, 2009.4.27, 2009.4.28, 2009.4.29, 2009.4.30, 2009.4.51, 2009.4.52, 2009.5.19, 2009.7.15, 2009.10.30, 2012.2.6
Change logchangelog.md
Dependenciesbase, cgi, containers, data-default (>=0.2), directory, filepath, haskell98, kibro (>=0.4.3), mps (>=2009.4.20), network, old-locale, old-time [details]
LicenseGPL
AuthorWang, Jinjing
MaintainerWang, Jinjing <nfjinjing@gmail.com>
CategoryWeb
Home pagehttp://www.haskell.org/haskellwiki/Panda
UploadedMon Apr 20 15:30:32 UTC 2009 by JinjingWang
DistributionsNixOS:2012.2.6
Downloads2456 total (122 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for hack-2009.4.20

Hack: a sexy Haskell Webserver Interface

Hack is a lazy port of Rack: the ruby webserver interface.

What does a hack app look like

module Main where

import Hack
import Hack.Handler.Kibro

hello :: Application
hello = \env -> return $ Response 
    { status  = 200
    , headers = [ ("Content-Type", "text/plain") ]
    , body    = "Hello World"
    }

main = run hello

1 minute tutorial

Install Hack

cabal install hack

Install Kibro (the only handler at the moment)

cabal install kibro

Install lighttpd 1.4.19 (used by kibro)

wget http://www.lighttpd.net/download/lighttpd-1.4.19.tar.gz
tar zxfv lighttpd-1.4.19.tar.gz
cd lighttpd-1.4.19
./configure --prefix=$HOME
make
make install

Create a new Kibro project

kibro new hello-world

Test if Kibro works

cd hello-world
kibro start

Create our hack app

put the following code in src/Main.hs

module Main where

import Hack
import Hack.Handler.Kibro

hello :: Application
hello = \env -> return $ Response 
    { status  = 200
    , headers = [ ("Content-Type", "text/plain") ]
    , body    = "Hello World"
    }

main = run hello

restart kibro

kibro restart