ihp-1.5.0: Haskell Web Framework
Copyright(c) digitally induced GmbH 2020
Safe HaskellNone
LanguageGHC2021

IHP.Router.Types

Description

 
Synopsis

Documentation

data ControllerRoute application Source #

A controller route entry. Three flavours:

frontControllerToWAIApp first merges all ControllerRouteTrie fragments into a single RouteTrie and tries a fast, method-aware lookup against it. On no match it falls back to the legacy ControllerRouteMap HashMap scan and, finally, to Attoparsec for the remaining custom parsers.

Constructors

ControllerRouteMap !(HashMap ByteString (application -> Application)) (Parser Application)

Auto-route HashMap + custom routes fallback parser (lazy — only evaluated on HashMap miss)

ControllerRouteParser !(Parser Application)

Custom route parser (for get, post, webSocketApp, startPage, etc.)

ControllerRouteTrie !RouteTrie

Pre-built trie fragment from the routes DSL. Method-aware; merged into the app-wide trie at startup.

data TypedAutoRouteError Source #

Constructors

BadType 
TooFewArguments 
NotMatched 
NoConstructorMatched

Thrown when parseUUIDArgument, parseIntArgument, etc. get passed an invalid value

Let's say we have a ShowProjectAction { id :: Id Project }.

When opening /ShowProject?projectId=ab55d579-80cd-4608-9a8f-c76dea6c2332 everything is fine. But when opening /ShowProject?projectId=not-an-uuid this exception will be thrown.

newtype BadHttpMethodException Source #

Thrown when the request uses an HTTP method that isn't part of the standard set (GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH, CONNECT, TRACE).

For example, a PROPFIND request from a WebDAV scanner. The error handler middleware translates this into a 400 Bad Request response.

Constructors

BadHttpMethodException 

Fields