Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
agrafix committed Aug 23, 2015
1 parent a94084d commit 8d8abbb
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 71 deletions.
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dist
cabal-dev
*.o
*.hi
*.chi
*.chs.h
.virthualenv
.DS_Store
.cabal-sandbox
cabal.sandbox.config
*~
.stack-work
*.dyn_o
*.dyn_hi
.hpc
.hsenv
*.prof
*.aux
*.hp
.stack-work/
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ before_install:
fi
- $CABAL update
- |
if [ $GHCVER = "head" ] || [ $GHCVER = "7.8.4" ] || [ $GHCVER = "7.10.2" ]; then
$CABAL install happy alex
export PATH=$HOME/.cabal/bin:$PATH
fi
$CABAL install happy alex
export PATH=$HOME/.cabal/bin:$PATH
install:
- $CABAL install --dependencies-only --enable-tests
- $CABAL configure -flib-Werror --enable-tests $MODE
Expand Down
71 changes: 71 additions & 0 deletions MORE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## Features

Another Haskell web framework for rapid development: This toolbox provides
everything you need to get a quick start into web hacking with haskell:

* fast routing (both typesafe and "untyped")
* middleware
* json
* sessions
* cookies
* database helper
* csrf-protection
* typesafe contexts

Benchmarks:

* https://github.com/philopon/apiary-benchmark
* https://github.com/agrafix/Spock-scotty-benchmark

## Important Links

* [Tutorial](https://www.spock.li/tutorial/)
* [Type-safe routing in Spock](https://www.spock.li/2015/04/19/type-safe_routing.html)

### Talks

* German: [Moderne typsichere Web-Entwicklung mit Haskell](https://dl.dropboxusercontent.com/u/15078797/talks/typesafe-webdev-2015.pdf) (by Alexander Thiemann)
* German: [reroute-talk](https://github.com/timjb/reroute-talk) (by Tim Baumann)

## Candy

### Extensions

The following Spock extensions exist:

* Background workers for Spock: [Spock-worker](http://hackage.haskell.org/package/Spock-worker)
* Digestive functors for Spock: [Spock-digestive](http://hackage.haskell.org/package/Spock-digestive)

### Works well with Spock

* User management [users](http://hackage.haskell.org/package/users)
* Data validation [validate-input](http://hackage.haskell.org/package/validate-input)
* Blaze bootstrap helpers [blaze-bootstrap](http://hackage.haskell.org/package/blaze-bootstrap)
* digestive-forms bootstrap helpers [digestive-bootstrap](http://hackage.haskell.org/package/digestive-bootstrap)

## Example Projects

* [funblog](https://github.com/agrafix/funblog)
* [makeci](https://github.com/openbrainsrc/makeci)
* [curry-recipes](https://github.com/timjb/reroute-talk/tree/06574561918b50c1809f1e24ec7faeff731fddcf/curry-recipes)

## Companies / Projects using Spock

* http://cp-med.com
* http://openbrain.co.uk
* http://findmelike.com
* https://www.tramcloud.net
* http://thitp.de

## Notes

Since version 0.7.0.0 Spock supports typesafe routing. If you wish to continue using the untyped version of Spock you can Use `Web.Spock.Simple`. The implementation of the routing is implemented in a separate haskell package called `reroute`.

Since version 0.5.0.0 Spock is no longer built on top of scotty. The
design and interface is still influenced by scotty, but the internal
implementation differs from scotty's.

## Thanks to

* Tim Baumann [Github](https://github.com/timjb) (lot's of help with typesafe routing)
* Tom Nielsen [Github](https://github.com/glutamate) (much feedback and small improvements)
99 changes: 53 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,17 @@ Spock
=====

[![Build Status](https://travis-ci.org/agrafix/Spock.svg)](https://travis-ci.org/agrafix/Spock)

[![Hackage Deps](https://img.shields.io/hackage-deps/v/Spock.svg)](http://packdeps.haskellers.com/reverse/Spock)

For more information and tutorials, visit [spock.li](http://www.spock.li)
[![Hackage](https://img.shields.io/hackage/v/Spock.svg)](http://hackage.haskell.org/package/Spock)

## Intro

Hackage: [Spock](http://hackage.haskell.org/package/Spock)
Tutorial: [Spock Tutorial](https://www.spock.li/tutorial/)

Another Haskell web framework for rapid development: This toolbox provides
everything you need to get a quick start into web hacking with haskell:

* fast routing (both typesafe and "untyped")
* middleware
* json
* sessions
* cookies
* database helper
* csrf-protection
Stackage: [Spock](https://www.stackage.org/package/Spock)

Benchmarks:
Another Haskell web framework for rapid development

* https://github.com/philopon/apiary-benchmark
* https://github.com/agrafix/Spock-scotty-benchmark

## Usage (Typesafe, recommended)
## Library Usage Example

```haskell
{-# LANGUAGE OverloadedStrings #-}
Expand All @@ -40,32 +24,46 @@ main =
runSpock 3000 $ spockT id $
do get ("echo" <//> var) $ \something ->
text $ T.concat ["Echo: ", something]

```

(read more at [Type-safe routing in Spock](https://www.spock.li/2015/04/19/type-safe_routing.html))
For more examples check the examples/ directory.

## Usage (Simple)
## Install

```haskell
{-# LANGUAGE OverloadedStrings #-}
import Web.Spock.Simple
* Using cabal: `cabal install Spock`
* Using Stack: `stack install Spock`
* From Source (cabal): `git clone https://github.com/agrafix/Spock.git && cd Spock && cabal install`
* From Source (stack): `git clone https://github.com/agrafix/Spock.git && cd Spock && stack build`

import qualified Data.Text as T
## Features

main =
runSpock 3000 $ spockT id $
do get ("echo" <//> ":something") $
do Just something <- param "something"
text $ T.concat ["Echo: ", something]
get ("regex" <//> "{number:^[0-9]+$}") $
do Just number <- param "number"
text $ T.concat ["Just a number: ", number]
```
Another Haskell web framework for rapid development: This toolbox provides
everything you need to get a quick start into web hacking with haskell:

## Install
* fast routing (both typesafe and "untyped")
* middleware
* json
* sessions
* cookies
* database helper
* csrf-protection
* typesafe contexts

* Using cabal: `cabal install Spock`
* From Source: `git clone https://github.com/agrafix/Spock.git && cd Spock && cabal install`
Benchmarks:

* https://github.com/philopon/apiary-benchmark
* https://github.com/agrafix/Spock-scotty-benchmark

## Important Links

* [Tutorial](https://www.spock.li/tutorial/)
* [Type-safe routing in Spock](https://www.spock.li/2015/04/19/type-safe_routing.html)

### Talks

* German: [Moderne typsichere Web-Entwicklung mit Haskell](https://dl.dropboxusercontent.com/u/15078797/talks/typesafe-webdev-2015.pdf) (by Alexander Thiemann)
* German: [reroute-talk](https://github.com/timjb/reroute-talk) (by Tim Baumann)

## Candy

Expand All @@ -89,16 +87,11 @@ The following Spock extensions exist:
* [makeci](https://github.com/openbrainsrc/makeci)
* [curry-recipes](https://github.com/timjb/reroute-talk/tree/06574561918b50c1809f1e24ec7faeff731fddcf/curry-recipes)

## Talks

* German: [Moderne typsichere Web-Entwicklung mit Haskell](https://dl.dropboxusercontent.com/u/15078797/talks/typesafe-webdev-2015.pdf) (by Alexander Thiemann)
* German: [reroute-talk](https://github.com/timjb/reroute-talk) (by Tim Baumann)

## Companies / Projects using Spock

* http://cp-med.com/
* http://openbrain.co.uk/
* http://findmelike.com/
* http://cp-med.com
* http://openbrain.co.uk
* http://findmelike.com
* https://www.tramcloud.net
* http://thitp.de

Expand All @@ -114,3 +107,17 @@ implementation differs from scotty's.

* Tim Baumann [Github](https://github.com/timjb) (lot's of help with typesafe routing)
* Tom Nielsen [Github](https://github.com/glutamate) (much feedback and small improvements)


## Misc

### Supported GHC Versions

* 7.6.3
* 7.8.4
* 7.10.2

### License

Released under the BSD3 license.
(c) 2013 - 2015 Alexander Thiemann
2 changes: 1 addition & 1 deletion Spock.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ benchmark spock-simple-example

source-repository head
type: git
location: git://github.com/agrafix/Spock.git
location: https://github.com/agrafix/Spock
9 changes: 9 additions & 0 deletions examples/ATypesafe.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{-# LANGUAGE OverloadedStrings #-}
import Web.Spock

import qualified Data.Text as T

main =
runSpock 3000 $ spockT id $
do get ("echo" <//> var) $ \something ->
text $ T.concat ["Echo: ", something]
13 changes: 13 additions & 0 deletions examples/Simple.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{-# LANGUAGE OverloadedStrings #-}
import Web.Spock.Simple

import qualified Data.Text as T

main =
runSpock 3000 $ spockT id $
do get ("echo" <//> ":something") $
do Just something <- param "something"
text $ T.concat ["Echo: ", something]
get ("regex" <//> "{number:^[0-9]+$}") $
do Just number <- param "number"
text $ T.concat ["Just a number: ", number]
12 changes: 0 additions & 12 deletions examples/simple/Main.hs

This file was deleted.

0 comments on commit 8d8abbb

Please sign in to comment.