waitra-0.0.1.0: A very simple Wai router

Copyright(c) 2015 Futurice
LicenseMIT (see the file LICENSE)
MaintainerOleg Grenrus <oleg.grenrus@iki.fi>
Stabilityexperimental
PortabilityGADTs and RankNTypes
Safe HaskellNone
LanguageHaskell2010

Network.Waitra

Contents

Description

Network.Waitra is a very simple router. It's useful for writing simple API web-services, when you don't want to use the whole Yesod stack.

Synopsis

Types

type Path = String Source

We use strings, as - unluckily - Applicative doesn't work with Text directly.

data Route where Source

Constructors

Route :: forall a. Method -> RE Char a -> (a -> Application) -> Route 

Static paths routes

Regex paths routes

Compilation

compile :: [Route] -> Middleware Source

Turn the list of routes into Middleware