frame-0.1: A simple web framework.

Frame.Router

Description

Definitions and functions for building a router

Synopsis

Documentation

fileFolderSource

Arguments

:: FrameRouter m 
=> String

Folder on the file system

-> [String]

Exploded URL

-> m Data

Either an Error404 or the File

The fileFolder function maps a URL to a filesystem folder

type Router = [String] -> StateT Vars (ReaderT Config IO) DataSource

A router maps from a path (list of URL parts) to some Data

startRouterSource

Arguments

:: Router

The router being executed

-> Config

The configuration

-> Validators

Validators to check fields against

-> [(FieldName, String)]

Initial fields (from the server)

-> String

The URL (from the server)

-> String

The session ID

-> Bool

Whether this is an Ajax request

-> IO Data

The data to be returned

Executes a given router and validators against request information from the server