Skip to content
/ Spock Public
forked from agrafix/Spock

Another Haskell web framework for rapid development

License

Notifications You must be signed in to change notification settings

loisch/Spock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spock

Build Status

Intro

Hackage: http://hackage.haskell.org/package/Spock

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

  • routing
  • middleware
  • json
  • blaze
  • sessions
  • cookies
  • database helper
  • csrf-protection
  • global state

Benchmarks: https://github.com/agrafix/Spock-scotty-benchmark

Usage

{-# LANGUAGE OverloadedStrings #-}
import Web.Spock

import qualified Data.Text as T

main = 
	spockT 3000 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]   

Install

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

Candy

The following Spock extensions exist:

Example Projects

Notes

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.

About

Another Haskell web framework for rapid development

Resources

License

Stars

Watchers

Forks

Packages

No packages published